You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is a Markdown file with a list of very long items:
❯ cat ./dash-separated-link-list.md
-[Link 1](#link-1) - Description of line 1.
-[Link 2](#link-2) - A very long description for the second link in the list. That description is more than 80 characters wide.
-[This is a very long title, pointing to an awesome article on incredible stuff we're not used to see everyday](#link-3) - Line #3's description.
-[Link number three](#this-is-a-very-long-url-that-is-pointing-to-a-really-really-great-website) - Fourth description.
It cleanly renders into a list of 4 items:
❯ /System/Volumes/Data/usr/local/opt/cmark/bin/cmark ./dash-separated-link-list.md
<ul><li><ahref="#link-1">Link 1</a> - Description of line 1.</li><li><ahref="#link-2">Link 2</a> - A very long description for the second link in the list. That description is more than 80 characters wide.</li><li><ahref="#link-3">This is a very long title, pointing to an awesome article on incredible stuff we're not used to see everyday</a> - Line #3's description.</li><li><ahref="#this-is-a-very-long-url-that-is-pointing-to-a-really-really-great-website">Link number three</a> - Fourth description.</li></ul>
Now if I try to tidy up the original markdown into a 80-chars wide format, I get the following:
❯ /System/Volumes/Data/usr/local/opt/cmark/bin/cmark --to commonmark --width 80 ./dash-separated-link-list.md
-[Link 1](#link-1) - Description of line 1.
-[Link 2](#link-2) - A very long description for the second link in the list.
That description is more than 80 characters wide.
-[This is a very long title, pointing to an awesome article on incredible
stuff we're not used to see everyday](#link-3) - Line \#3's description.
-[Link number
three](#this-is-a-very-long-url-that-is-pointing-to-a-really-really-great-website)- Fourth description.
Which renders into a list with an additional sub-list item:
❯ /System/Volumes/Data/usr/local/opt/cmark/bin/cmark --to commonmark --width 80 ./dash-separated-link-list.md | /System/Volumes/Data/usr/local/opt/cmark/bin/cmark
<ul><li><ahref="#link-1">Link 1</a> - Description of line 1.</li><li><ahref="#link-2">Link 2</a> - A very long description for the second link in the list.
That description is more than 80 characters wide.</li><li><ahref="#link-3">This is a very long title, pointing to an awesome article on incredible
stuff we're not used to see everyday</a> - Line #3's description.</li><li><ahref="#this-is-a-very-long-url-that-is-pointing-to-a-really-really-great-website">Link number
three</a><ul><li>Fourth description.</li></ul></li></ul>
This is due to an edge-case that is splitting an item content just before the dash located right after the link.
This bug has been reported first to the pandoc project at: jgm/pandoc#6497 . An interesting thing here is that the previous implementation was supporting this edge case while the new one based on cmark does not.
For reference, here the version of cmark I'm using, installed with brew on macOS Catalina:
This bug can also be reproduced with the cmark-gfm formulae provided by brew:
❯ /System/Volumes/Data/usr/local/opt/cmark-gfm/bin/cmark-gfm --version
cmark-gfm 0.29.0.gfm.0 - CommonMark with GitHub Flavored Markdown converter
(C) 2014-2016 John MacFarlane
❯ /System/Volumes/Data/usr/local/opt/cmark-gfm/bin/cmark-gfm --to commonmark --width 80 ./dash-separated-link-list.md | /System/Volumes/Data/usr/local/opt/cmark-gfm/bin/cmark-gfm
<ul><li><ahref="#link-1">Link 1</a> - Description of line 1.</li><li><ahref="#link-2">Link 2</a> - A very long description for the second link in the list.
That description is more than 80 characters wide.</li><li><ahref="#link-3">This is a very long title, pointing to an awesome article on incredible
stuff we're not used to see everyday</a> - Line #3's description.</li><li><ahref="#this-is-a-very-long-url-that-is-pointing-to-a-really-really-great-website">Link number
three</a><ul><li>Fourth description.</li></ul></li></ul>
The text was updated successfully, but these errors were encountered:
Here is a Markdown file with a list of very long items:
It cleanly renders into a list of 4 items:
Now if I try to tidy up the original markdown into a 80-chars wide format, I get the following:
Which renders into a list with an additional sub-list item:
This is due to an edge-case that is splitting an item content just before the dash located right after the link.
This bug has been reported first to the
pandoc
project at: jgm/pandoc#6497 . An interesting thing here is that the previous implementation was supporting this edge case while the new one based oncmark
does not.For reference, here the version of
cmark
I'm using, installed withbrew
on macOS Catalina:This bug can also be reproduced with the
cmark-gfm
formulae provided bybrew
:The text was updated successfully, but these errors were encountered: