-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clarify link reference definition interruptions and continuation text #689
base: master
Are you sure you want to change the base?
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -3485,7 +3476,6 @@ can occur one after another, without intervening blank lines. | |||
[bar]: /bar-url | |||
"bar" | |||
[baz]: /baz-url | |||
|
|||
[foo], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the spec used one blank line between things, rather than doubles?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 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. |
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.