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

Do not accept footnote definitions with line breaks #125

Merged
merged 1 commit into from
Oct 31, 2023

Conversation

notriddle
Copy link
Contributor

Fixes #124

This change brings commonmark-hs into alignment with markdown-it and hugo/goldmark. It's close to GitHub, but GitHub doesn't parse the backslashes as hard line breaks.

It's odd that link reference definitions are allowed to have line breaks and footnote definitions aren't, but it's not worth it to be gratuitously different.

@notriddle notriddle force-pushed the notriddle/footnote-paragraph-break branch from 49a6b88 to fc30da2 Compare October 30, 2023 21:53
@jgm
Copy link
Owner

jgm commented Oct 30, 2023

I'm tempted to think we should allow line breaks but normalize the labels, just as we do for reference links.

Pandoc also doesn't allow line breaks in note labels, but I can't recall whether there's a reason. I never put spaces in these, myself, but if I did, there'd be a chance the document would break when reformatted, if the space turned to a newline.

@notriddle
Copy link
Contributor Author

Pipe table cells can't have line breaks in them, so a working autoformatter needs to know about these extensions anyway.

@jgm
Copy link
Owner

jgm commented Oct 31, 2023

That's true, but footnote labels and link labels are so alike that it complicates the reader/writer's mental model to have to keep in mind this distinction.

@jgm
Copy link
Owner

jgm commented Oct 31, 2023

I think we can merge this now (disallowing newlines altogether is better than allowing blank lines), but I am not completely happy with the no newlines thing and might want to revisit that.

@jgm jgm merged commit 91444cb into jgm:master Oct 31, 2023
@notriddle notriddle deleted the notriddle/footnote-paragraph-break branch November 1, 2023 00:39
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.

[fuzz result] footnote definition labels with blank lines are allowed
2 participants