Use newlines to separate inserted images (#164632)

Fixes #164610
This commit is contained in:
Matt Bierner
2022-10-25 12:21:36 -07:00
committed by GitHub
parent 21431fce38
commit 882cdc0a17
2 changed files with 5 additions and 2 deletions

View File

@@ -67,6 +67,8 @@ interface UriListSnippetOptions {
* If `undefined`, tries to infer this from the uri.
*/
readonly insertAsImage?: boolean;
readonly separator?: string;
}
export function createUriListSnippet(document: vscode.TextDocument, uris: readonly vscode.Uri[], options?: UriListSnippetOptions): vscode.SnippetString | undefined {
@@ -93,8 +95,8 @@ export function createUriListSnippet(document: vscode.TextDocument, uris: readon
snippet.appendText(`](${mdPath})`);
if (i <= uris.length - 1 && uris.length > 1) {
snippet.appendText(' ');
if (i < uris.length - 1 && uris.length > 1) {
snippet.appendText(options?.separator ?? ' ');
}
});
return snippet;