Cicero Draft normalises indents to 3 spaces instead of the standard 4

オープン
#398 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
markdown, typescript
領域
backend

調査の方向性

Start by reading the cicero draft command path that formats template grammar output and trace where indentation is normalized. Reproduce with an indented list and sublist; the expected result is that their relative positions are preserved in the generated Markdown. The issue gives no file or test names, so first locate the command and its formatting tests.

索引モデルが issue の本文から書いたものです。

説明

maintainer-engaged

Describe the bug
Running cicero draft over a template grammar file to create a sample.md file results in indents being normalised to only having three spaces. This can result in inconsistencies in certain implementations where a list item were intended to be sublists but are instead normalised to being on the same level.

From the CommonMark standard:
"the position of the text after the list marker determines how much indentation is needed in subsequent blocks in the list item. If the list marker takes up two spaces, and there are three spaces between the list marker and the next non-whitespace character, then blocks must be indented five spaces in order to fall under the list item."

To Reproduce
Steps to reproduce the behavior:

  1. Create a simple template grammar which uses an indented list (see screenshot 1)
  2. Run cicero draft command (output is screenshot 2)
  3. Attempt to view resultant markdown file (the VSCode default 'preview' for example) (see screenshot 3)

Expected behavior
Relative position of lists and sublists established in the template grammar should be preserved.

Screenshots
1: four spaces
2: three spaces
3: error

Further context
From the CommonMark spec:
"Indentation. If a sequence of lines Ls constitutes a list item according to rule accordproject/cicero#1, accordproject/cicero#2, or accordproject/cicero#3, then the result of indenting each line of Ls by 1-3 spaces (the same for each line) also constitutes a list item with the same contents and attributes. If a line is empty, then it need not be indented."

See the significant discussion on this point in the commonmark spec

主要言語
TypeScript
スター
86
フォーク
69
平均マージ
6分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

accordproject/markdown-transform のほかの issue

accordproject/markdown-transform の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。