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
Incorrectly detects an ordered list when there isn't one #95
Comments
Fixed. Thanks for reporting it. |
@ec1oud To prevent a misunderstanding, I fixed generating bad output as in: $ printf '.\n' | ./md2html/md2html
<ol start="0">
<li></li>
</ol> After the fix applied: $ printf '.\n' | ./md2html/md2html
<p>.</p> I am confused by the info in the https://bugreports.qt.io/browse/QTBUG-78870 that only the leave callback is called. Imho that cannot be true because |
Yes you're right, the enter callback is called with MD_BLOCK_OL. I just didn't push anything on my stack because there were no list items, so it's probably really a good idea to check whether it's empty before popping. |
But that is imho not a correct fix. Consider the empty list is nested in a parent list. The stack isn't then empty, yet you will happily pop it and end the parent list too early. |
Should empty lists still happen in some cases? |
Yes. The list item mark not followed by text but just a new-line forms an empty list item with no text. $ printf '*\n' | /src/cmark/build/src/cmark
<ul>
<li></li>
</ul> And these can be nested in each other. E.g. $ printf '*\n *\n *\n' | /src/cmark/build/src/cmark
<ul>
<li>
<ul>
<li></li>
<li></li>
</ul>
</li>
</ul> |
OK. Will have to take care of that then. Thanks for your help; I'll get back to it in a day or two. |
Why you cannot push to the list stack directly from the |
If the input is simply ".\n" (an actual newline there), the leave-block callback is invoked with MD_BLOCK_OL. Found by fuzzing: https://bugreports.qt.io/browse/QTBUG-78870
The text was updated successfully, but these errors were encountered: