-
Notifications
You must be signed in to change notification settings - Fork 29k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Asterisk seems to be treated specially in documentation preview #42353
Comments
Thanks for reporting! |
@ramya-rao-a Are you saying that you are using There are two APIs (old/new). The old is |
For Go, I am using the old |
We support markdown content in JSDocs so we don’t escape anything. The * is probably being treated as the start of italics. Can you escape the * manually in the doc? |
@mjbvz Thats right. The text between the 2 * is being treated as italics in typescript. So what's the expectation here? |
The expectations might be different between JavaScript/TypeScript/JSDoc and Go/godoc. I'd expect JSDoc to render markdown content if the Markdown plugin is configured, but not otherwise. In other words, I'd expect the preview to be as close as possible to what I'd see in generated HTML. The current behavior doesn't seem to check the configuration before rendering? godoc doesn't seem to support Markdown as far as I can tell, so it shouldn't be rendered in VSCode either. |
@ramya-rao-a No good solution. Either you convert your jsdocs to markdown or we disable markdown everywhere. I don't think we can detect when a jsdoc comment should or shouldn't be markdown (although if you surround the |
@mjbvz Anyway I can tell the hoverprovider to treat given content as just string and not markdown? |
@ramya-rao-a In general, or for a given jsdoc? |
Closing this as-designed for jsdocs. No good solution without breaking jsdocs that do want to use markdown. Workaround is to escape any special markdown characters, such as |
From @jawnsy on January 29, 2018 17:43
Description
Documentation preview requires an asterisk to be escaped, while
godoc
does not require the escaping. This is a pretty minor issue but I'd expect vscode-go to behave as close togodoc
as possible.Actual behavior
This comment:
is rendered like so:
Notice that the * is missing between "".
Expected behavior
godoc -http
renders it like so:I'd expect this to be correct, though I haven't read godoc spec.
Workaround
You can escape the * in the comment (
\*
), like so:Then it appears to be rendered as expected:
Version info
vscode-go 0.6.73
VSCode version info (OS: Windows 10):
Copied from original issue: microsoft/vscode-go#1486
The text was updated successfully, but these errors were encountered: