Skip to content
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

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

douglas-raillard-arm
Copy link
Contributor

@douglas-raillard-arm douglas-raillard-arm commented Sep 11, 2024

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

@pep8speaks
Copy link

pep8speaks commented Sep 11, 2024

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

@mgeier
Copy link
Member

mgeier commented Sep 14, 2024

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.

input_format += '-native_divs+raw_html'
input_format += '-native_divs'
input_format += '+raw_html'
input_format += '+lists_without_preceding_blankline'
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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.
@douglas-raillard-arm
Copy link
Contributor Author

PR updated to enable the option outside of the pandoc version check

@mgeier mgeier merged commit 84b9575 into spatialaudio:master Oct 1, 2024
12 checks passed
@mgeier
Copy link
Member

mgeier commented Oct 1, 2024

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants