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

Trailing period prevents links within emphasis #317

Closed
cliss opened this issue Apr 21, 2015 · 5 comments
Closed

Trailing period prevents links within emphasis #317

cliss opened this issue Apr 21, 2015 · 5 comments

Comments

@cliss
Copy link

cliss commented Apr 21, 2015

Re-opened here from markdown-it #94. As was pointed out to me by @rlidwka, this seems to be broken in the dingus as well, despite what I initially thought below. As per @rlidwka, it appears the trailing period is causing the confusion.


I'm seeing a bug wherein a link within an emphasis/bold block is not showing as strong.

Example:

> md.render('This is a __[test of a link in bold](http://www.github.com/)__.')
'<p>This is a __<a href="http://www.github.com/">test of a link in bold</a>__.</p>\n'

I would have expected:

'<p>This is a <strong><a href="http://www.github.com/">test of a link in bold</a></strong>.</p>'

You'll note that this works as expected when the link is not included:

> md.render('This is a __test of bold__.')
'<p>This is a <strong>test of bold</strong>.</p>\n'

This seems to work as I expected on the Commonmark Dingus.

If this user error, my utmost apologies; please let me know what I'm doing wrong!

@colinodell
Copy link
Contributor

I ran those strings through Babelmark2 and am seeing similar results.

@colinodell
Copy link
Contributor

Actually, it looks the issue occurs regardless of which punctuation character appears at the end.

Could this be a bug where the ending __ isn't being identified as a right-flanking delimiter run?

@jgm
Copy link
Member

jgm commented Apr 21, 2015

See commonmark/commonmark.js#12 - this is the same issue, I believe, and a solution is sketched out there. I mean to give this some further thought, but will probably implement what is described there. Comments welcome.

@puzrin
Copy link
Contributor

puzrin commented Apr 28, 2015

I think, that's implementation bug in markdown-it: markdown-it/markdown-it#97

Spec looks good for me with last commits.

@puzrin
Copy link
Contributor

puzrin commented Apr 28, 2015

Tests missed. Example with link needed in spec.

@jgm jgm closed this as completed in f167c32 Apr 28, 2015
jgm added a commit that referenced this issue Apr 28, 2015
jgm added a commit to commonmark/cmark that referenced this issue Apr 28, 2015
jgm added a commit to commonmark/commonmark.js that referenced this issue Apr 28, 2015
Knagis added a commit to Knagis/CommonMark.NET that referenced this issue May 2, 2015
talum pushed a commit to github/cmark-gfm that referenced this issue Sep 14, 2021
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

4 participants