Skip to content

Allow footnote definitions to not be separated by blank lines#825

Merged
Martin1887 merged 2 commits intopulldown-cmark:branch_0.9.3from
GuillaumeGomez:footnote-def
Jan 27, 2024
Merged

Allow footnote definitions to not be separated by blank lines#825
Martin1887 merged 2 commits intopulldown-cmark:branch_0.9.3from
GuillaumeGomez:footnote-def

Conversation

@GuillaumeGomez
Copy link
Contributor

This is a change allowing to fix rust-lang/rust#100638.

It's a bit strange that link definitions can follow each others but that footnote definitions can't so I think for consistency, allowing it would be more logical.

As for the code, it's not great as it forces to "look ahead" in case this is a footnote definition and then return and come back into parse_block to actually put this new footnote definition into the tree. If you have suggestions for improving it, it'd be very welcome! :)

@Martin1887
Copy link
Collaborator

Martin1887 commented Jan 27, 2024

Thanks for your work. Footnotes are not included in the GFM spec but in the footnotes example of its guide to Markdown consecutive footnotes work.

Please note this pull request should be created against the master branch.

Also note that tests must be written into spec .txt files, and .rs files are created automatically when running cargo test --all-features. Also note the failed test in the CI, very probably caused because the .rs file has been regenerated from the outdated .txt spec.

@GuillaumeGomez
Copy link
Contributor Author

Isn't the master branch an API breaking change? Because if so, I'd still like to have this fix merged into a 0.9.4 release so I can update rustdoc dependency and fix the bug directly there. I can backport this change to the master branch though.

I'll try to see how to make the tests work.

@GuillaumeGomez
Copy link
Contributor Author

CI passed. \o/

@Martin1887
Copy link
Collaborator

OK, 0.10 version will be released soon, and it contains many bugfixes and enhancements, but also some minor breaking changes. So, we can generate a 0.9.4 release with this change and #694.

Thanks.

@Martin1887 Martin1887 merged commit c7b848a into pulldown-cmark:branch_0.9.3 Jan 27, 2024
@GuillaumeGomez GuillaumeGomez deleted the footnote-def branch January 27, 2024 16:19
@GuillaumeGomez
Copy link
Contributor Author

Thanks a lot! I'll backport the fix in the next days.

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.

2 participants