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
Various <em> issues #1546
Comments
Yes, but If you would like to create a PR working on this I would be happy to review it 😁 |
That is a good point. However (without looking at any code) I would imagine that once the unordered list use case of a particular Will have to see about time to work on that PR... |
I've looked around a bit and the problem is clearly that the em regex assumes that I tried to apply some simple fixes and I found that the test for example 373 explicitly expects this behavior. The results I got are still peculiar in that
There is a clear difference in the regex for the handling of For
For
For some reason, these regexes seem to assume that the sets of characters allowed to follow starting and ending |
You could look at the CommonMark spec to see the differences for |
It seems like the difference in
|
Right... I see that Example 354 allows emphasis in situations like mine, for |
@oliversturm @UziTech This is already fixed in the version v0.8.2 |
The demo does look correct in master. The fix in #1636 will be in the next release. |
Describe the bug
Formatting of blocks like
*em text*
and_em text_
breaks in various different waysTo Reproduce
Steps to reproduce the behavior:
Try this text (Marked Demo link):
The result is this:
Clearly, the
<em>
tags are mangled (two of them surrounding the firstdiv
) or missing.Commonmark renders this block correctly.
Interesting note: Marked renders the block correctly if you remove the last part (involving
*data-bind*
).Now try this text - it's the same as before, just using
_
instead of*
: (Marked Demo link)The result is this:
The result is interesting because is is broken in a different way - everything from the first
_
to the last one is wrapped in one tag. This reminds me of my previous issue #1390 (but it's not a regression as such - my test cases for that issue still work correctly today.)With this scenario, Commonmark doesn't render as expected either:
However, their result makes more sense if you want to argue that samples like
_div_s
are invalid because the ending_
is not followed by whitespace.Now I'm not a markdown spec expert, but it is my impression that
*
and_
can be regarded as interchangeable and should render the same result. I may be wrong in this understanding.Locally I'm using marked version 0.7.0. I assume that's what the Marked Demo also uses at this time.
The text was updated successfully, but these errors were encountered: