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

em formatting issues using underscore (_) #1390

Closed
oliversturm opened this issue Dec 17, 2018 · 5 comments
Closed

em formatting issues using underscore (_) #1390

oliversturm opened this issue Dec 17, 2018 · 5 comments
Labels
category: inline elements L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue

Comments

@oliversturm
Copy link

Delimiting underscores are not detected correctly if they are followed by commas. Here's a snippet that demonstrates the issue:

_This should be em_, but the end is not detected correctly due to the comma.

_If I have some em_, followed by a comma, and then _some further em_ that's detected correctly, the two are combined.

The result of passing this text through marked 0.5.2 is this:

<p>_This should be em_, but the end is not detected correctly due to the comma.</p>
<p><em>If I have some em_, followed by a comma, and then _some further em</em> that’s detected correctly, the two are combined.</p>

As you can see, several underscores are still included in the HTML output, and the two "em" parts in the second paragraph have been combined incorrectly.

The CommonMark Demo formats the output as expected, leaving no underscores in the HTML.

@UziTech UziTech added L1 - broken Valid usage causes incorrect output OR a crash AND there is no known workaround for the issue category: inline elements labels Dec 17, 2018
@UziTech
Copy link
Member

UziTech commented Dec 17, 2018

Thanks for reporting this.

CommonMark demo

<p><em>This should be em</em>, but the end is not detected correctly due to the comma.</p>
<p>_If I have some em _, followed by a comma, and then <em>some further em</em> that's detected correctly, the two are combined.</p>

marked demo

<p>_This should be em_, but the end is not detected correctly due to the comma.</p>
<p><em>If I have some em_, followed by a comma, and then _some further em</em> that&#39;s detected correctly, the two are combined.</p>

@styfle
Copy link
Member

styfle commented Dec 17, 2018

I believe this is fixed on master. Maybe we should release soon?

@oliversturm
Copy link
Author

@UziTech I see you copied some results into your comment. Just to keep things very clear here - I think you made a mistake - the CommonMark output I see is this (note the second line is different from yours):

<p><em>This should be em</em>, but the end is not detected correctly due to the comma.</p>
<p><em>If I have some em</em>, followed by a comma, and then <em>some further em</em> that's detected correctly, the two are combined.</p>

@UziTech
Copy link
Member

UziTech commented Feb 19, 2019

looks like this was fixed in 0.6.0

@UziTech UziTech closed this as completed Feb 19, 2019
@oliversturm
Copy link
Author

Confirmed: my original test cases render correctly now. Thanks for the update!

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

3 participants