clarify link reference definition interruptions and continuation text#689
clarify link reference definition interruptions and continuation text#689rsc wants to merge 1 commit intocommonmark:masterfrom
Conversation
Other blocks can interrupt a link reference definition, and link reference definitions can have continuation text that is not fully prefixed, following the rules of paragraph continuation text. Document both these facts and give examples. Fixes commonmark#688.
|
See #688 (comment). |
wooorm
left a comment
There was a problem hiding this comment.
I confirmed all tests with my own parser (micromark), in which they 100% work. So that at least means these changes matched my previous interpretation of the spec.
This would probably break several parsers though, as @vassudanagunta points out, specifically laid out in this comment. I personally am OK with making the CM spec stricter and less “open to interpretation”.
I still prefer a solution where it is explained that definitions are made from paragraphs / “Content”. Then the laziness is “inherited” and it doesn’t have to be explained twice.
| "bar" | ||
| [baz]: /baz-url | ||
|
|
||
| [foo], |
There was a problem hiding this comment.
It's not strictly needed, but it's in a section about being able to omit intervening blank lines, so I dropped the blank line to emphasize that in another context.
| <p>[foo]</p> | ||
| ```````````````````````````````` | ||
|
|
||
|
|
There was a problem hiding this comment.
I thought the spec used one blank line between things, rather than doubles?
There was a problem hiding this comment.
I am happy to do whatever is the convention. The nearby text seemed to be using doubles.
|
I'm happy to adjust or remove the continuation text examples. |
|
It doesn't fully describe the behavior of the current implementation yet: - [aaa]: /
(According to the spec, this line is **not** the title, so this is not a continuation of the link
reference definition but a new paragraph that is the following sibling of the list rather than
a child of the list item.) foo barThe current implementation handles the parenthesized text as the child of the list item, but according to the spec, even after applying this pull request, it should be a separate paragraph. My proposal is to make link reference definitions an inline construct rather than a block construct, with the requirement that they must be at the beginning of a paragraph and end at the end of a line. We also need to specify that paragraphs containing only link reference definitions are not rendered at all, but are still counted as paragraphs when checking for list tightness commonmark/commonmark.js#269. Alternatively, we could specify in addition to this pull request that a link reference definition can have an optional continuation text that is rendered as a paragraph in place of the link reference definition: - [aaa]: / "title"
This is a continuation text of the link reference definition, so this is rendered as
a paragraph inside the list item. |
Other blocks can interrupt a link reference definition,
and link reference definitions can have continuation text
that is not fully prefixed, following the rules of paragraph
continuation text.
Document both these facts and give examples.
Fixes #688.