Closed antons closed 8 years ago
I can't reproduce it, either in latest release or development version, or in 5.0.1.
Parsing the file you give me results in the following:
<ul>
<li>
</li>
<li>
</li>
</ul>
Can you be more specific about how to replicate this?
Thanks!
@fletcher I forgot to check which extensions we are using. The hang happens only with escaped-line-breaks
.
I should note that only one line is enough. This alone triggers it:
* \
And this too:
1. \
That did it. I can reproduce. Now just need to track down the source of the problem. Thanks!
UPDATE: Spent a lot of time trying to track this down. Interestingly, during my work the problem began to reproduce itself both with and without the escaped line breaks option. I couldn't identify a specific problem with the PEG recipes.
The problem is that when a list item contains only "\", then the parser tries to process the raw block "\n". For whatever reason, that causes the parser to fail to match, and to endlessly cycle through "recipes" looking for a match. I'm not sure why this happens, and certainly welcome any input.
That said, I am able to prevent the error from reaching the user by ensuring that there is something left in the buffer before continuously cycling through the yyparse() function. A description of the problem is added to the source (parser.leg
-> process_raw_blocks()
).
I will leave this open for now, as I would prefer a real fix rather than just avoiding the problem. At least until MMD 6 exists. ;)
One of our customers discovered that MMD parser hangs when a list item (either bulleted or ordered) contains only a backslash:
We reproduced the issue as far back as 5.0.1, but did not try versions earlier than that.