bug fix: HR vs YAML block parsing in breakQuartoMd #13816
Draft
+37
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm not sure if we should fix this, but I wanted to submit it for discussion.
There is a difference between how Pandoc and
breakQuartoMdparse horizontal rules versus YAML blocks withPandoc "strongly recommends" that you put blank lines before and after an HR, but only checks for the latter.
OTOH
breakQuartoMdonly parses---as an HR if it is both preceded and followed by a blank line. Otherwise it might be starting a YAML block (if it finds the end of one).This change tells
breakQuartoMdto treat---as an HR if it followed by a blank line, like Pandoc. It no longer looks at line before.The Problem
The
quarto-marimoindex.qmdhas a construction that looks like:and now that it relies on
breakQuartoMd, it loses some code blocks and fails.I'm completely fine with telling them to add a newline, but thought I'd raise this fix for consideration.
Blast radius
The function gets a lot of use, so it's little scary to change it
But the change does not affect the parsing of actual YAML block openings, since those would always have content in the next line.