Dash-separated long list items rendered as sublist
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず、--to commonmark --width 80 を使用して cmark 0.29.0 で問題を再現し、その後、報告に示されているように出力を cmark にもう一度通します。リスト項目を折り返す際にリンクの後のダッシュがどのように処理されるかを追跡し、ラウンドトリップによって説明が同じリスト項目内に保持され、サブリストが作成されないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
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><a href="#link-1">Link 1</a> - Description of line 1.</li>
<li><a href="#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><a href="#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><a href="#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><a href="#link-1">Link 1</a> - Description of line 1.</li>
<li><a href="#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><a href="#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><a href="#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: https://github.com/jgm/pandoc/issues/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:
❯ brew install cmark
(...)
==> Downloading https://homebrew.bintray.com/bottles/cmark-0.29.0_1.catalina.bottle.tar.gz
==> Downloading from https://akamai.bintray.com/3a/3af95418f96f4b0cec4bd76abaab312f3caf4cea591f38d3b725f15068d06491?__gda__=exp=1593691219~hmac=7f6c15036b995f36438e934f5bd44ec8
######################################################################## 100.0%
==> Pouring cmark-0.29.0_1.catalina.bottle.tar.gz
🍺 /usr/local/Cellar/cmark/0.29.0_1: 17 files, 724.9KB
❯ /System/Volumes/Data/usr/local/opt/cmark/bin/cmark --version
cmark 0.29.0 - CommonMark converter
(C) 2014-2016 John MacFarlane
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><a href="#link-1">Link 1</a> - Description of line 1.</li>
<li><a href="#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><a href="#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><a href="#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>
- 主要言語
- C
- スター
- 2k
- フォーク
- 702
- 平均マージ
- 2日 17時間
- マージ済み PR(30日)
- 7
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
commonmark/cmark のほかの issue
-
Incorrect `parser->offset` advancement for closing fenced code blocks in `parse_code_block_prefix`対応中かも @cpruijsen が 35 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
commonmark/cmark#590 · コメント 3 件 ·
メンテナーはふだん 3 日以内に返信
-
API documentation is missing an explanation of CMARK_NODE_CUSTOM_BLOCK and CMARK_NODE_CUSTOM_INLINEオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
commonmark/cmark#441 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
Inline code languageオープン
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
commonmark/cmark#626 · コメント 4 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
commonmark/cmark#624 ·
メンテナーはふだん 3 日以内に返信
-
Single-space blank line evicts a list-item continuation再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
commonmark/cmark#618 ·
メンテナーはふだん 3 日以内に返信
commonmark/cmark の issue をすべて見る
似ている issue
-
bug
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
VirusTotal/yara#2255 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
neutralinojs/neutralinojs#1861 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] Filename sequence expansion (`+`) panics on numeric values exceeding `i32::MAX`対応中かも @muntasir-396 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
CCExtractor/ccextractor#2402 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
FujiNetWIFI/fujinet-lib#204 ·
メンテナーはふだん 1 日以内に返信
-
os:linux
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
mpv-player/mpv#18649 ·
メンテナーはふだん 1 日以内に返信