From 9e1705b600225187df40eaebf6904c7704636f3e Mon Sep 17 00:00:00 2001 From: AXT-AyaKoto <148830788+AXT-AyaKoto@users.noreply.github.com> Date: Wed, 3 Jun 2026 15:30:12 +0900 Subject: [PATCH] Fix JSDoc @example followed by fenced code block in hover MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When @example is immediately followed by a ``` code fence, insert a newline instead of " — " so markdown renders correctly. Fixes #5167. --- src/languages/features/typescript/languageFeatures.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/languages/features/typescript/languageFeatures.ts b/src/languages/features/typescript/languageFeatures.ts index 561f66364b..41d026f200 100644 --- a/src/languages/features/typescript/languageFeatures.ts +++ b/src/languages/features/typescript/languageFeatures.ts @@ -577,7 +577,8 @@ function tagToString(tag: ts.JSDocTagInfo): string { tagLabel += `\`${paramName.text}\``; if (rest.length > 0) tagLabel += ` — ${rest.map((r) => r.text).join(' ')}`; } else if (Array.isArray(tag.text)) { - tagLabel += ` — ${tag.text.map((r) => r.text).join(' ')}`; + const text = tag.text.map((r) => r.text).join(' '); + tagLabel += `${text.startsWith("```") ? "\n" : " — "}${text}`; } else if (tag.text) { tagLabel += ` — ${tag.text}`; }