question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Indented Link Reference Definitions not parsed correctly

See original GitHub issue

I was migrating our project to use flexmark instead of pegdown, when I came across the following issue with link reference defs.

Example markdown:

This note demonstrates some of what [Markdown][1] is capable of doing.
....
*Note: the fourth item uses the Unicode character for [Roman numeral four][2].*

  [1]: http://daringfireball.net/projects/markdown/
  [2]: http://www.fileformat.info/info/unicode/char/2163/index.htm

Expected result:

This note demonstrates some of what Markdown is capable of doing. … Note: the fourth item uses the Unicode character for Roman numeral four.

Given result (using CommonMark profile):

This note demonstrates some of what Markdown is capable of doing.
....
Note: the fourth item uses the Unicode character for [Roman numeral four][2].

[2]: http://www.fileformat.info/info/unicode/char/2163/index.htm


CommonMark spec:

A link reference definition consists of a link label, indented up to three spaces, followed by a colon (😃, optional whitespace (including up to one line ending), a link destination, optional whitespace (including up to one line ending), and an optional link title, which if it is present must be separated from the link destination by whitespace. No further non-whitespace characters may occur on the line.


When I add an additional newline between the definitions, or when I remove the indentation (2 spaces) from the definitions, it parses/renders correctly.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
vschcommented, Feb 7, 2017

@Elmervc, version 0.13.6 released. Maven central update may take some time.

0reactions
vschcommented, Feb 8, 2017

@Elmervc, please don’t hesitate to open an issue on any discrepancy you encounter.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Clarify title parsing of link reference definitions #697 - GitHub
The text for link reference definitions is a bit hard to comprehend and a bit contradictory. See the discussion here.
Read more >
Hanging Indents in Google Docs or Word (Made Easy)
You use hanging indents in a bibliography, reference list, and works cited. A hanging indent is where the second and subsequent lines of...
Read more >
How do I create a hanging indent in Word on my Works Cited ...
Place your cursor at the beginning of your citation, and highlight it. Right click your mouse; Select Paragraph from the resulting pop up...
Read more >
0.7 - CommonMark Spec
A link reference definition consists of a link label, indented up to three spaces, followed by a colon ( : ), optional blank...
Read more >
Indenting #defines - Stack Overflow
Why are #define s typically not indented? Is there a reason one wouldn't indent (e.g. like this code below)? #ifdef SDCC #if ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found