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

Intra-word emphasis can match the wrong asterisks #1607

Closed
rriegs opened this issue Feb 23, 2020 · 1 comment
Closed

Intra-word emphasis can match the wrong asterisks #1607

rriegs opened this issue Feb 23, 2020 · 1 comment
Labels
category: inline elements L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue

Comments

@rriegs
Copy link

rriegs commented Feb 23, 2020

Describe the bug
Asterisks may be used to indicate intra-word emphasis, as in levio*SAH* for levio<em>SAH</em>, however, matching over-aggressively seeks to pair opening asterisks with asterisks at ends of words, sometimes skipping the intended intra-word asterisk.

To Reproduce
See this Marked demo link:

It’s levi*OH*sa, not levio*SAH.*

yields

It’s levi<em>OH<em>sa, not levio</em>SAH.</em>

Note the intra-word asterisks are converted to another layer of emphasis, rather than interrupting emphasis as they should. Another expression of this same bug is this:

*Some*thing is wrong *here.*

which yields

<em>Some*thing is wrong *here</em>

leaving unconverted asterisks.

Expected behavior
Compare to these CommonMark Dingus links, which yield

It’s levi<em>OH</em>sa, not levio<em>SAH.</em>

and

<em>Some</em>thing is wrong <em>here</em>
@UziTech UziTech added category: inline elements L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue labels Feb 24, 2020
@UziTech
Copy link
Member

UziTech commented Feb 24, 2020

see #1522

There are currently 47 common mark spec tests in the Emphasis and strong emphasis category that are not passing.

If you would like to help PRs are always welcome. 😁

@styfle styfle closed this as completed in 6fc0721 Apr 10, 2020
zhenalexfan pushed a commit to zhenalexfan/MarkdownHan that referenced this issue Nov 8, 2021
zhenalexfan pushed a commit to zhenalexfan/MarkdownHan that referenced this issue Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: inline elements L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue
Projects
None yet
Development

No branches or pull requests

2 participants