-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
converter.makeHtml with dashes terminated with nbsp takes a long time #312
Comments
The bug was verified. For some reason, nbsp breaks the hr algorithm and dashes are interpreted as list marks! I'm looking into it |
Upon further inspection, it seems the bug occurs with any character (and not only with nbsp) after a series of dashes or asterisks. From what I could gather, this bug is present from the beginning of showdown and is common to other markdown parsers (such as marked or commonmark). The problem lies with the list parser. Basically it interprets the line as a series of nested lists (which is wrong). I'm currently working on a fix, but I have to rewrite the list parser. |
Thanks very much. Would it be possible to also publish a new npm version? |
already did, :) |
Wasn't sure whether to create a new issue but it seems this is still a problem when more characters are added to the right of nbsp this time. eg:
|
Yes, it seems that, although the output is now correct, something is still slowing down the library in this specific context. I'm investigating. However, I would ask you to open a new issue |
Will do. |
Replacing all non-breaking spaces with normal spaces breaks their intended use. To reproduce: (new showdown.Converter()).makeHtml('Enough text to\u00a0make the\u00a0following wrap to\u00a0a\u00a0new line') Expected result: A paragraph that never wraps immediately after an article or preposition. Observed result: A paragraph that wraps wherever it pleases. Please consider revising the fix, e.g. by deleting non-breaking spaces at the end of line only (which is never the intended use of a non-breaking space anyway). |
Actually, I can rollback the "nbsp fix", since the issue was not caused by nbsp but rather a logic bug in the parser, which was fixed. I ask you to open a new issue with this, and I will roll a option for allowing nbsp |
To reproduce:
As dashes are added to the left, it takes more and more time. Removing the nbsp (char code 160) from the end makes it behave much better.
The text was updated successfully, but these errors were encountered: