diff --git a/extensions/typescript-language-features/src/utils/previewer.ts b/extensions/typescript-language-features/src/utils/previewer.ts index 0c1e880162d..2b2108ccd57 100644 --- a/extensions/typescript-language-features/src/utils/previewer.ts +++ b/extensions/typescript-language-features/src/utils/previewer.ts @@ -11,19 +11,26 @@ function getTagBodyText(tag: Proto.JSDocTagInfo): string | undefined { return undefined; } + // Convert to markdown code block if it is not already one + function makeCodeblock(text: string): string { + if (text.match(/^\s*[~`]{3}/g)) { + return text; + } + return '```\n' + text + '\n```'; + } + switch (tag.name) { case 'example': // check for caption tags, fix for #79704 - const captionTagMatches = tag.text.match('