MarkdownReader throws NotSupportedException on task lists (- [ ])

オープン 初心者向け
#7,982 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@Laurianti がすでに取り組んでいます。

2026年11月25日 から。

  • #7983 @Laurianti による — オープン
  • #7994 @luisquintanilla による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
74/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp
領域
api, backend

調査の方向性

MarkdownParser.GetTextから始めます。issueではTaskListがNotSupportedExceptionに至ると報告されています。リストブロックとインライン要素がどのように対応付けられているかを追ってください。リスト処理に関する既存のMarkdownParserテストを確認し、未チェックとチェック済みのタスク項目について、マーカーをテキストとして保持するテストを追加してください。MarkdownReaderが例のドキュメントを例外を発生させずに読み込み、リスト要素を生成すれば完了です。

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

説明

area-ai untriaged
Description

MarkdownReader throws a NotSupportedException on any Markdown that contains a task list (- [ ] / - [x]), so the whole document cannot be read.

MarkdownParser builds its pipeline with UseAdvancedExtensions(), which enables Markdig's task list extension, but MarkdownParser.GetText has no case for the resulting TaskList inline and falls through to throw new NotSupportedException($"Inline type '{inline.GetType().Name}' is not supported.").

Reproduction Steps
<PackageReference Include="Microsoft.Extensions.DataIngestion.Markdig" Version="10.11.1-preview.1.26569.2" />
using System.Text;
using Microsoft.Extensions.DataIngestion;

string markdown = """
    # Checklist

    - [ ] first task
    - [x] second task
    """;

using MemoryStream stream = new(Encoding.UTF8.GetBytes(markdown));
IngestionDocument document = await new MarkdownReader().ReadAsync(stream, "checklist.md", "text/markdown");
Console.WriteLine($"{document.EnumerateContent().Count()} elements");
Expected behavior

The document is read; the task list items become list elements, for example with their [ ] / [x] marker kept as text.

Actual behavior
System.NotSupportedException: Inline type 'TaskList' is not supported.
   at Microsoft.Extensions.DataIngestion.MarkdownParser.GetText(ContainerInline containerInline)
   at Microsoft.Extensions.DataIngestion.MarkdownParser.MapLeafBlockToElement(LeafBlock block, Boolean previousWasBreak, String elementMarkdown)
   at Microsoft.Extensions.DataIngestion.MarkdownParser.MapListBlock(ListBlock listBlock, Boolean previousWasBreak, String documentMarkdown, String listMarkdown)
   at Microsoft.Extensions.DataIngestion.MarkdownParser.MapBlock(String documentMarkdown, Boolean previousWasBreak, Block block)
   at Microsoft.Extensions.DataIngestion.MarkdownParser.Map(MarkdownDocument markdownDocument, String documentMarkdown, String identifier)
Regression?

Not known.

Known Workarounds

Removing the [ ] / [x] markers from the text before reading it.

Configuration
  • Microsoft.Extensions.DataIngestion.Markdig 10.11.1-preview.1.26569.2
  • .NET 10, Windows x64
  • The pipeline is not configurable from MarkdownReader, so the extension cannot be turned off by the caller.
Other information

Task lists are common in documentation pages (checklists, to-do sections); in a set of 145 real documentation pages, several could not be read for this reason.

主要言語
C#
スター
3.3k
フォーク
928
平均マージ
2日 12時間
マージ済み PR(30日)
23

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

はじめの一歩

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

dotnet/extensions のほかの issue

dotnet/extensions の issue をすべて見る

似ている issue

C# の issue をもっと見る

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

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