Skip to content

Read lazy paragraph continuations off of refdefs#782

Merged
Martin1887 merged 1 commit intopulldown-cmark:masterfrom
notriddle:notriddle/lazy-paragraph-off-linkdef
Nov 19, 2023
Merged

Read lazy paragraph continuations off of refdefs#782
Martin1887 merged 1 commit intopulldown-cmark:masterfrom
notriddle:notriddle/lazy-paragraph-off-linkdef

Conversation

@notriddle
Copy link
Collaborator

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.

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
@notriddle notriddle force-pushed the notriddle/lazy-paragraph-off-linkdef branch from 44f0d48 to fb8d3f6 Compare November 15, 2023 04:59
@Martin1887
Copy link
Collaborator

It looks correct, thanks!

@Martin1887 Martin1887 merged commit 1e25d28 into pulldown-cmark:master Nov 19, 2023
@notriddle notriddle deleted the notriddle/lazy-paragraph-off-linkdef branch November 19, 2023 11:51
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