-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
Include tilde (~) in markdown syntax tokens #146417
Conversation
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
Signed-off-by: Babak K. Shandiz <babak.k.shandiz@gmail.com>
@babakks Shouldn't https\://example.com
&\; https://example.com |
Also, IMO Though I admit this is minor and also debatable. EDIT: Huh? I noticed there should be now a parameter for that, but I don't see it in 1.65.0. Maybe it didn't make it into the API yet? The commit is from Nov/2020 though... |
@babakks If you want to ensure reliable behavior, you'd have to know which markdown spec VSCode actually uses. I assume it's likely it may be using CommonMark, which is a much more "proper" standard than the original -- and, at least on latest version I saw now, it does include escaping for those characters and many others as you can see here: If you still don't want to rely on backslash escaping, there's also the option of preceding them with a comment (I tested that too on all three): But I think the best solution would be confirming whether it's using CommonMark and which version, and then include all escaping of that spec's version, specially because we may be missing some other edge cases. EDIT: In fact, even in the oldest version listed, the set of escapable chars in CommonMark was the same, it seems: |
Ah OK, VSCode API does state that it's using CommonMark: /**
* Human-readable text that supports formatting via the [markdown syntax](https://commonmark.org).
*
* Rendering of {@link ThemeIcon theme icons} via the `$(<name>)`-syntax is supported
* when the {@linkcode supportThemeIcons} is set to `true`.
*
* Rendering of embedded html is supported when {@linkcode supportHtml} is set to `true`.
*/
export class MarkdownString { So, the full list of chars should be:
!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~ |
I generally agree but let's keep this PR focused on the ~ issue |
This PR fixes #146219