[Discussion] Handling Markdown JSDoc Content #16468
Labels
Awaiting More Feedback
This means we'd like to hear from more people who would be helped by this feature
Domain: JSDoc
Relates to JSDoc parsing and type generation
Duplicate
An existing issue was already created
Suggestion
An idea for TypeScript
VS Code Tracked
There is a VS Code equivalent to this issue
Uh oh!
There was an error while loading. Please reload this page.
From: microsoft/vscode#27936
Problem
JSDocs often contain markdown content. TypeScript does not try to parse markdown when generating the documentation for intellisense and hovers. VSCode does try to show the documentation it gets from TypeScript as markdown. In certain edge cases, this can cause unexpected behavior:
In this case,
@Hello
is treated as a jsdoc tag instead of part of the markdown code block.Possible solutions
A few thoughts on how we could work around this:
TypeScript parses jsdocs as markdown. Not ideal because it adds a dependency to typescript but this would be the most complete solution.
TypeScript special cases a few markdown patterns (such as those for codeblocks) but does not try to fully parse the documentation as markdown.
TypeScript treats any tag that is not part of the jsdoc spec as content instead of as a jsdocs tag. This is the simplest solution but I'm not sure if people are using custom jsdocs tags that this would break
// cc @mhegazy
The text was updated successfully, but these errors were encountered: