Skip to content

Fix JSDoc @example hover when followed by code fence (#5167, #3107)#5350

Open
AXT-AyaKoto wants to merge 1 commit into
microsoft:mainfrom
AXT-AyaKoto:axt-ayakoto/fix/5167
Open

Fix JSDoc @example hover when followed by code fence (#5167, #3107)#5350
AXT-AyaKoto wants to merge 1 commit into
microsoft:mainfrom
AXT-AyaKoto:axt-ayakoto/fix/5167

Conversation

@AXT-AyaKoto

@AXT-AyaKoto AXT-AyaKoto commented Jun 3, 2026

Copy link
Copy Markdown

Fixes #5167, Fixes #3107

When a JSDoc @example tag is immediately followed by a fenced code block, insert a newline before the content instead of so markdown renders correctly in hover tooltips.

Example

The following JSDoc example is now rendered correctly.

/**
 * Double `n`.
 * 
 * @example
 * ```ts
 * 1 + 2
 * ```
 * 
 * @param n - The number you want to double
 * @returns a
 */
const double = (n: number): number => n * 2;
Expected rendering result (VSCode) Latest Stable (Monaco Editor v0.55.1) Correction result

When @example is immediately followed by a ``` code fence, insert a
newline instead of " — " so markdown renders correctly. Fixes microsoft#5167.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant