MarkdownReader throws ArgumentNullException on a table with an empty cell
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
MarkdownParser.GetCellsから始め、単一ブロックの場合をMapBlockまで追います。スタックトレースから、空の段落を要素コンストラクターに渡す経路を特定します。テーブルセルに関する既存のパーサーテストを確認し、空のセルがnullにマッピングされ、空でないセルは引き続き解析されることを示すテストを追加します。報告されたテーブルが例外を出さずに読み込まれ、空のセルがnullとして表現されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
MarkdownReader throws when a Markdown table has an empty cell, so one empty cell fails the whole document.
Package: Microsoft.Extensions.DataIngestion.Markdig 11.0.0-preview.1.26560.3
var reader = new MarkdownReader();
using var stream = new MemoryStream(Encoding.UTF8.GetBytes("| a | b |\n| --- | --- |\n| | 1 |\n"));
await reader.ReadAsync(stream, "doc", "text/markdown"); // throws
The same table with x in the empty cell reads fine.
System.ArgumentNullException: Value cannot be null. (Parameter 'markdown')
at Microsoft.Extensions.DataIngestion.IngestionDocumentElement..ctor(String markdown)
at Microsoft.Extensions.DataIngestion.IngestionDocumentParagraph..ctor(String markdown)
at Microsoft.Extensions.DataIngestion.MarkdownParser.MapLeafBlockToElement(LeafBlock block, Boolean previousWasBreak, String elementMarkdown)
at Microsoft.Extensions.DataIngestion.MarkdownParser.MapBlock(String documentMarkdown, Boolean previousWasBreak, Block block)
at Microsoft.Extensions.DataIngestion.MarkdownParser.GetCells(Table table, String outputContent)
at Microsoft.Extensions.DataIngestion.MarkdownParser.MapBlock(String documentMarkdown, Boolean previousWasBreak, Block block)
at Microsoft.Extensions.DataIngestion.MarkdownParser.Map(MarkdownDocument markdownDocument, String documentMarkdown, String identifier)
at Microsoft.Extensions.DataIngestion.MarkdownParser.Parse(String markdown, String identifier)
at Microsoft.Extensions.DataIngestion.MarkdownReader.ReadAsync(Stream source, String identifier, String mediaType, CancellationToken cancellationToken)
Markdig gives an empty cell one empty ParagraphBlock, so GetCells takes the 1 => branch rather than 0 => null. MapBlock then passes an empty string to IngestionDocumentParagraph, and IngestionDocumentElement's constructor rejects null or empty. The code is the same on main.
Empty cells are common in tables that come from PDFs, OCR and spreadsheets: in our corpus 5 of 16 documents failed to ingest this way. I'd expect an empty cell to map to null, like a cell with no blocks.
We work around it by writing U+200B into empty cells before reading and removing it from the chunks afterwards.
- 主要言語
- C#
- スター
- 3.3k
- フォーク
- 919
- 平均マージ
- 2日 2時間
- マージ済み PR(30日)
- 35
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
dotnet/extensions のほかの issue
-
area-ai bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dotnet/extensions#7954 ·
メンテナーはふだん 1 日以内に返信
-
ServiceEndpointWatcher logs normal cancellation as an error対応中かも @seragAhmed が 5 日前に担当しました。 オープンbug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
dotnet/extensions#7940 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
OpenAISpeechToTextClient sends Ogg MemoryStream audio with an .mp3 filename対応中かも @Manish-1kumar が 16 日前に担当しました。 オープンarea-ai untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
dotnet/extensions#7900 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Unable to obtain the UsageContent and FinishReason of response.incomplete対応中かも @jaeminbird が 20 日前に担当しました。 オープンarea-ai bug untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
dotnet/extensions#7893 ·
メンテナーはふだん 1 日以内に返信
-
AI Chat Web template: scaffolded Identity pages are inaccessible because App.razor applies an interactive render mode unconditionally対応中かも @valkiara が 20 日前に担当しました。 オープンarea-ai-templates untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
dotnet/extensions#7889 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
dotnet/extensions の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
microsoft/microsoft-ui-reactor#1567 ·
メンテナーはふだん 1 日以内に返信
-
priority:p2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
QuantConnect/Lean#10191 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
openclaw/openclaw-windows-node#2287 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
AI Generated CI/CD ⚒️ Flaky-tests 🐦 go 🏃
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
valkey-io/valkey-glide#7772 ·
メンテナーはふだん 1 日以内に返信