-
-
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
[Link Reference Definition] Block starts in Link Title that spans multiple lines break the definition #622
Comments
But see https://spec.commonmark.org/0.29/#precedence |
Related issue: #605. I think the underlying issue here is that the reference implementations parse these as paragraphs, for parsing efficiency, but they aren't actually spec'd as paragraphs. So the spec may need some tightening up in this respect. |
@jgm Thanks for replying.
In the Spec, the First I find it hard to use a state machine to parse definitions, so I look into how commonmark.js implements this. Now I know it treats I think using backslashes may be a good solution as long as we carefully process the backslash with new line? |
@movsb I am currently writing a state machine based spec and implementation on how to parse CM, this is what lead me to this issue as well. |
@wooorm Oh, look forward to seeing that. A question: what conditions will make a content closed? A blank line? My state machine is only for definitions parsing. It reports a state whether blank lines can be continue lines.
It's a WIP, don't know if it works. BTW, Parsing blank lines is the most tricky thing in my implementation. |
This conversation is a bit off topic, but thematic breaks, atx headings, setext heading underlines, fenced code blocks, HTML blocks (except type 7), blank lines, block quotes, and lists/list-items all close content. Indented code does not. I personally don’t see blank lines as difficult, so I’m unsure what you mean calling them tricky? |
What the spec says:
But if block starts like
#
,>
,*
start a new line of link title. The Link will be broken.I see that the reference CommonMark javascript implementation first parses link reference definition lines into a paragraph, then tries to parse it as a link reference definition. But block starts like
#
,*
and>
as well as blank lines break Paragraphs. So, the link reference definitions are also broken.Example link reference definition (dingus link):
Just think that
#
,>
,*
, especially blank lines are common in Titles, for example, a commit message in commonmark.js:what GitHub rendered:
Adding backslashs seems to work. but the spec doesn't statement this.
If I try to use backslash to escape a new line, the new line preserves (not be a space), so does the backslash. (dingus link)
The text was updated successfully, but these errors were encountered: