-
Notifications
You must be signed in to change notification settings - Fork 159
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
Markdown parser gets multiple-underscores-inside-italics wrong #389
Comments
I wonder if this is the same as #376 ? |
thanks for reporting, yes we have tests for the full spec (Im pretty sure for both issues you reported). If you need a near/mid term fix feel free to enable and fix them. There is not much that can go wrong. |
If you need any help/pointers feel free to ask. |
I think the behaviour was a bit unspecified before CommonMark. With CommonMark, I think the rules are that there should be spaces if you want nesting:
|
This might be related to #376 |
Yes, it is. In the previous issue, @amazingant points to the relevant bits of the CommonMark spec:
|
Has there been any resolution to this? Does |
This is a rather unfortunate bug and as issue #2411 shows, leads to "real world" issues. In that particular scenario for Fantomas, the headers are the names of configuration tokens, which all have underscores, making the file as a whole hard to read. I don't mind taking a stab at this sometime soon (no promises), perhaps @dsyme or @tpetricek know off-hand where things like this get parsed/rendered? Seems to me that the parser needs some look-ahead/behind to determine that |
I believe it’s here FSharp.Formatting/src/FSharp.Formatting.Markdown/MarkdownParser.fs Lines 165 to 181 in a55c29b
|
The markdown parser gets underscores-inside-italics wrong. For instance,
On both GitHub and CommonMark, it's rendered as an italic with underscores:
A asterisk_one_two B
But FSharp.Formatting.Markdown parses it as a nested emphasis:
(Actually, to be honest, I don't know what is the correct behavior. I'm assuming that CommonMark is correct here.)
Here are some more examples:
A asterisk_one_two B
A asterisk_one_two_three B
A asterisk_one_two_three_four B
A underscore_one_two B
A underscore_one_two_three B
A underscore_one_two_three_four B
The text was updated successfully, but these errors were encountered: