commonmark-spec icon indicating copy to clipboard operation
commonmark-spec copied to clipboard

clarify link reference definition interruptions and continuation text

Open rsc opened this issue 4 years ago • 3 comments

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.

rsc avatar Sep 04 '21 22:09 rsc

See https://github.com/commonmark/commonmark-spec/issues/688#issuecomment-913242483.

vassudanagunta avatar Sep 05 '21 23:09 vassudanagunta

I'm happy to adjust or remove the continuation text examples.

rsc avatar Sep 07 '21 13:09 rsc

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 bar

The 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.

taku0 avatar Feb 13 '23 12:02 taku0