-
Notifications
You must be signed in to change notification settings - Fork 130
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: Fix bullet list parsing #813
markdown: Fix bullet list parsing #813
Conversation
Hello @douglas-raillard-arm! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found: There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2024-10-01 12:12:46 UTC |
829a61c
to
595124e
Compare
Thanks for this PR! This will probably also be fixed by #812, but I think it would be good to merge this PR as well, because it will also make it work for Pandoc < 2. |
src/nbsphinx/__init__.py
Outdated
input_format += '-native_divs+raw_html' | ||
input_format += '-native_divs' | ||
input_format += '+raw_html' | ||
input_format += '+lists_without_preceding_blankline' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this guarded with version 1.13+?
AFAICT this was already available earlier: jgm/pandoc@7772262
I think this can be added without version check, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the record, this is an earlier commit where the option was added: jgm/pandoc@5afd373, see jgm/pandoc#972.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changelog states that this extension was fixed in pandoc 1.13.2 (2014-12-20):
Fix Ext_lists_without_preceding_blankline bug (#1636, Artyom).
https://pandoc.org/releases.html
So since that is what I tested is the "new" behavior and that 1.13 is already ancient with a check already in place, I just piggy backed on it. I don't think anyone would use that old version anyway so it probably will make little difference in practice, I'm happy to remove the check if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this extension was fixed in pandoc 1.13.2
If we don't want to use it before the fix, the version check for '1.13'
would strictly speaking not be sufficient, we would have to add a check for '1.13.2'
.
But I think we can allow it before the fix anyway, because list with buggy spacing are better then no lists at all, right?
I don't think anyone would use that old version anyway so it probably will make little difference in practice
I agree that it won't make any difference in practice, but given that we know that the feature was introduced much earlier, we might just as well put it before that version check.
If you think the check for '1.13'
has become irrelevant, we can also remove it. But I don't think it hurts, and I have no problem with keeping the check in there, even if nobody might ever use that version again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll move it outside of the block then, if someone is stuck on an old version it's probably best indeed to have something a bit buggy rather than nothing.
Jupyter markdown allows bullet list to start right after the previous element, without any blank line in between. The default settings of pandoc is to not recognize that as a bullet list. Therefore, enable the pandoc markdown extension that makes the blank line optional.
595124e
to
ee46629
Compare
PR updated to enable the option outside of the pandoc version check |
Thanks! |
Jupyter markdown allows bullet list to start right after the previous element, without any blank line in between. The default settings of pandoc is to not recognize that as a bullet list.
Therefore, enable the pandoc markdown extension that makes the blank line optional.
This deals with the issue reported on nbconvert: jupyter/nbconvert#917 in the same way as this PR jupyter/nbconvert#2177