-
Notifications
You must be signed in to change notification settings - Fork 863
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
Simple strong/em case fails to be parsed (***foo bar***) #63
Comments
I think if you want em + strong you need to use underscores. From what I understand, 3 asterisks is supposed to be used in order to produce actual asterisks, e.g. foo bar |
@lorddev Having |
Ok. I must having been thinking of Google+, which implements only the asterisks and underscores subset of markdown. |
This is quite probably a parsing bug as most other parsers treat it as (I know I made some decisions on purpose of what to parse and what to just ignore but I don't think this was one of them) |
@ashb That's what I think too. I apologize for not submitting a pull request; I'm still learning the code base and how the parsing works. I did, however, add the test case in the |
The parsing of strong and em is a little bit ... interesting (along with most of the rest of the parsing) and has some fruity backtracking like stuff in it. The Line 977 in 50f6d69
|
Hmmm I've taken a look and the way the strong/em state is currently split out is what's causing the problem I suspect. The problem is that it doesn't keep the ordering of which of a strong/em was last opened, so it closes the wrong one (the strong) as this is first in the regex pattern and doesn't know that it should check if it should close an em instead of a strong. I suspect we'll have to rewrite that parser helper func to use a single state variable instead of two split ones. |
The the sample case of
***foo bar***
fails to parse correctly.It should be parsed as
["em", ["strong", "foo bar"]]
but is instead parsed as[["strong", "*foo bar"], "*"]
.However if spaces are added (
* **foo** *
), it produces the correct HTML.The text was updated successfully, but these errors were encountered: