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

Incorrect handling of hard line breaks inside of Link and Image nodes. #211

Closed
jackdewinter opened this issue Feb 1, 2021 · 1 comment
Closed

Comments

@jackdewinter
Copy link

Per my discussion on the forums:

Issue

When I use a single backslash at the end of a line within a Link Reference Definition's link label, it seems to invalidate the entire construct. However, when 2 spaces are used instead, it parses fine.

Expected Behavior

Per discussion with @jgm, both these Markdown snippets should provide a link that contains a hard line break in a validly constructed link.

Discussion

Using 2 space characters at the end of the line in a link:

[  
foo]: /uri

[  
foo]

provides the following HTML:

<p><a href="/uri"><br />
foo</a></p>

However, if I use the blackslash at the end of the line instead of the two space characters:

[\
foo]: /uri

[\
foo]

I get:

<p>[<br />
foo]: /uri</p>
<p>[<br />
foo]</p>
@jgm
Copy link
Member

jgm commented Feb 1, 2021

cmark gets this right, as does jgm/commonmark-hs.
I need to investigate why the js implementation doesn't.

@jgm jgm closed this as completed in 3c1ef74 Feb 1, 2021
taku0 added a commit to taku0/cmark-el that referenced this issue Apr 3, 2021
commonmark/commonmark.js#211

commonmark/commonmark.js@3c1ef74
Author: John MacFarlane <jgm@berkeley.edu>
Date:   Sun Jan 31 22:03:55 2021 -0800
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