Read lazy paragraph continuations off of refdefs#782
Merged
Martin1887 merged 1 commit intopulldown-cmark:masterfrom Nov 19, 2023
Merged
Conversation
This matches the behavior of [GitHub], [commonmark.js], and [commonmark-hs]. [markdown-it], however, does not treat these as lazy continuations. It seems like [commonmark-hs's parser] and [commonmark.js's parser] both work by parsing these refdefs as paragraphs first, then pulling out the refdef. [GitHub]: https://gist.github.com/notriddle/c2498c6afd1bca1a11e23623559ff58a [commonmark.js]: https://spec.commonmark.org/dingus/?text=%3E%20-%20%5Bfoo%5D%3A%20test%0A%3E%20bar%0A%3E%20%0A%3E%20%3E%20%5Bbar%5D%3A%20test%0A%3E%20%5Bbaz%5D%3A%20rstr%0A%3E%20%5Bbar%5D [commonmark-hs]: https://pandoc.org/try/?params=%7B%22text%22%3A%22%3E+-+%5Bfoo%5D%3A+test%5Cn%3E+bar%5Cn%3E+%5Cn%3E+%3E+%5Bbar%5D%3A+test%5Cn%3E+%5Bbaz%5D%3A+rstr%5Cn%3E+%5Bbar%5D%22%2C%22to%22%3A%22html5%22%2C%22from%22%3A%22commonmark_x%22%2C%22standalone%22%3Afalse%2C%22embed-resources%22%3Afalse%2C%22table-of-contents%22%3Afalse%2C%22number-sections%22%3Afalse%2C%22citeproc%22%3Afalse%2C%22html-math-method%22%3A%22plain%22%2C%22wrap%22%3A%22auto%22%2C%22highlight-style%22%3Anull%2C%22files%22%3A%7B%7D%2C%22template%22%3Anull%7D [markdown-it]: https://markdown-it.github.io/#md3=%7B%22source%22%3A%22%3E%20-%20%5Bfoo%5D%3A%20test%5Cn%3E%20bar%5Cn%3E%20%5Cn%3E%20%3E%20%5Bbar%5D%3A%20test%5Cn%3E%20%5Bbaz%5D%3A%20rstr%5Cn%3E%20%5Bbar%5D%22%2C%22defaults%22%3A%7B%22html%22%3Afalse%2C%22xhtmlOut%22%3Afalse%2C%22breaks%22%3Afalse%2C%22langPrefix%22%3A%22language-%22%2C%22linkify%22%3Atrue%2C%22typographer%22%3Atrue%2C%22_highlight%22%3Atrue%2C%22_strict%22%3Atrue%2C%22_view%22%3A%22src%22%7D%7D [commonmark-hs's parser]: https://github.com/jgm/commonmark-hs/blob/6ec393d5c7950b5edd410d448a00344277c971ad/commonmark/src/Commonmark/Blocks.hs#L607 [commonmark.js's parser]: https://github.com/commonmark/commonmark.js/blob/9f548fedcb74b527825078fe31f5748499f2937d/lib/blocks.js#L212
44f0d48 to
fb8d3f6
Compare
Collaborator
|
It looks correct, thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This matches the behavior of GitHub, commonmark.js, and commonmark-hs.
markdown-it, however, does not treat these as lazy continuations.
It seems like commonmark-hs's parser and commonmark.js's parser both work by parsing these refdefs as paragraphs first, then pulling out the refdef.