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

Punctuation set is different from the spec #121

Closed
rlidwka opened this issue Jul 13, 2017 · 1 comment
Closed

Punctuation set is different from the spec #121

rlidwka opened this issue Jul 13, 2017 · 1 comment

Comments

@rlidwka
Copy link
Contributor

rlidwka commented Jul 13, 2017

CommonMark/spec.txt defines this punctuation set:

!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~

Regexp in commonmark.js/lib/inlines.js uses smaller character set:

!"#%&'()*,-./:;?@[\]_{}

As a result, ^_test_ is not rendered as emphasis, even though according to spec it should (and cmark renders it as an emphasis).

$ echo '^_test_' | ./cmark/build/src/cmark 
<p>^<em>test</em></p>
$ echo '^_test_' | ./commonmark.js/bin/commonmark 
<p>^_test_</p>

Original issue: markdown-it/markdown-it#380

@SamSaffron
Copy link

Note, fixing this will cause:

https://derp.com?_test_=1

To render as:

<p>https://derp.com?<em>test</em>=1</p>

It is 100% correct to fix the implementation so it correctly implements the spec, but the spec does do some weird things with legit URLs in the wild.

@jgm jgm closed this as completed in bd4efe5 Aug 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants