Preserve information about leading whitespace in paragraphs
まだ誰も着手していません。
評価
調査の方向性
失敗している ParserTest.noBlockTypes シナリオから始め、すべてのブロックタイプを無効にした状態で Parser.builder() を調べ、その後、入力行がどのように Text ノードになるかを追跡します。サンプル入力でテストを実行し、2 番目の Text ノードに先頭の 2 つのスペースが保持されていることを確認します。
索引モデルが issue の本文から書いたものです。
説明
When using DocumentParser with no enabled block types, the Text nodes do not include whitespaces at the beginning of a line.
For example, when we use a parser with no enabled block types and the input is:
- text 1
- text 2
the expected result is a document containing two Text nodes:
- Text("- text 1")
- Text(" - text 2")
but the second Text is "- text 2" (without preceding whitespaces)
To better illustrate here is a sample test that fails:
public class ParserTest {
...
@Test
public void noBlockTypes() {
String given = "- text 1\n - text 2";
Parser parser = Parser.builder().enabledBlockTypes(Collections.<Class<? extends Block>>emptySet()).build();
Node document = parser.parse(given);
Node child = document.getFirstChild();
assertThat(child, instanceOf(Paragraph.class));
child = child.getFirstChild();
assertThat(child, instanceOf(Text.class));
assertEquals("- text 1", ((Text) child).getLiteral());
child = child.getNext();
assertThat(child, instanceOf(SoftLineBreak.class));
child = child.getNext();
assertThat(child, instanceOf(Text.class));
assertEquals(" - text 2", ((Text) child).getLiteral());
}
}
- 主要言語
- Java
- スター
- 2.7k
- フォーク
- 336
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
commonmark/commonmark-java のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
commonmark/commonmark-java#460 ·
-
Second code span not recognised after an unclosed backtick string and another code span対応中かも @TanbirRamim が 13 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
commonmark/commonmark-java#458 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 74/100
commonmark/commonmark-java#457 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
commonmark/commonmark-java#443 · コメント 4 件 ·
-
Option to define custom flanking/canOpen/canClose rules for delimiters再び着手できるかも @abhiramaab が 57 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンenhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
commonmark/commonmark-java#428 · コメント 4 件 ·
commonmark/commonmark-java の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
NationalSecurityAgency/ghidra#9748 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
spring-mcp-tools
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
explyt/spring-plugin#591 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
jenkinsci/build-monitor-plugin#1367 ·
メンテナーはふだん 1 日以内に返信
-
waiting-for-triage
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
spring-cloud/spring-cloud-openfeign#1443 ·
メンテナーはふだん 1 日以内に返信