Skip to content
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

Markdown preview handles escaping incorrectly #6689

Closed
vors opened this issue May 23, 2016 · 6 comments
Closed

Markdown preview handles escaping incorrectly #6689

vors opened this issue May 23, 2016 · 6 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug markdown Markdown support issues verified Verification succeeded
Milestone

Comments

@vors
Copy link

vors commented May 23, 2016

Markdown preview rendered should treat \< as <, \[ as [ and so on

  • VSCode Version:

Version 1.1.1
Commit def9e32
Date 2016-05-13T13:29:20.776Z
Shell 0.37.6
Renderer 49.0.2623.75
Node 5.10.0

  • OS Version: Windows 10

Steps to Reproduce:

  1. create a file foo.md with content
SYNOPSIS
Add-GistFile -Id \<string\> -Path \<string\[\]\> \[\<CommonParameters\>\]
  1. Open markdown preview for it

Expected result

SYNOPSIS
Add-GistFile -Id -Path <string[]> []

Actual result

image

@rebornix
Copy link
Member

This is the default behavior of Markdown, if you are going to escape < or >, use &lt; or &gt;. See https://daringfireball.net/projects/markdown/syntax#autoescape for more info.

@bpasero bpasero added bug Issue identified by VS Code Team member as probable bug markdown Markdown support issues labels May 24, 2016
@bpasero bpasero added this to the Backlog milestone May 24, 2016
@vors
Copy link
Author

vors commented Jun 2, 2016

That's true for the original markdown spec that @rebornix referenced.
I'm not an expert in markdown variations, but I would guess that VSCode / Atom preiew is oriented more to CommonMark then to the original (Jonh Gruber's) markdown.

For example, VSCode supports ``` and ~~~ syntax for codeblocks, which is not part of the original markdown spec.

I would suggest follow CommonMark anyway, because

  1. it has a clear spec with test sets
  2. it's widely adopted and mostly compatible with GitHub Flavored Markdown.

From that point of view, CommonMark has a clear guidence about back-slash escaping.

@rebornix
Copy link
Member

rebornix commented Jun 3, 2016

@vors, thanks your detailed info. Currently we are using markd.js , which targets both the original makrdown and gfm. That's why you can see those fenced blocks work and terrible escaping hack. But good news is, like what you suggested, we are moving the markdown parser to commonmark and we will supporr backslash escaping.

@vors
Copy link
Author

vors commented Jun 3, 2016

It looks like markd.js will switch to CommonMark.

As is, it's not GFM compatible (because horrible escaping hack works just fine on github).
Check it out

< horrible hack >

I personally find "\<" way more readable in the plain-text then "&lt".

@rebornix
Copy link
Member

rebornix commented Jun 3, 2016

Agree, current markd.js GFM support is not 100% compatible (IMHO) but that's Okay. Once we finish #6106 we can revisit this issue.

@bpasero
Copy link
Member

bpasero commented Jun 16, 2016

Seems to work ok for me with our new markdown extension:

image

@bpasero bpasero closed this as completed Jun 16, 2016
@bpasero bpasero modified the milestones: June 2016, Backlog Jun 16, 2016
@bpasero bpasero assigned kieferrm and unassigned bpasero Jun 16, 2016
@bpasero bpasero added the verified Verification succeeded label Jul 4, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug markdown Markdown support issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants