tryParseMarkdownToBlocks throws on a numbered or check list item that starts with <details>
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- html, markdown, typescript
- 領域
- frontend
調査の方向性
Start by reproducing with editor.tryParseMarkdownToBlocks("1. <details>") and checking the HTML from markdownToHTML for the same input. The likely cause is the toggle list item's details parse rule matching inside numbered and check list items, which leaves a blockContainer with a blockGroup but no blockContent. Done when the table's throwing inputs return blocks without error, and Markdown from blocksToMarkdownLossy loads again.
索引モデルが issue の本文から書いたものです。
説明
What’s broken?
editor.tryParseMarkdownToBlocks throws when a numbered or check list item starts with a <details> tag:
Error: blockContainer node does not contain a blockContent node in its children: blockContainer(blockGroup(blockContainer(paragraph)))
The editor can produce this Markdown itself. Type <details> as plain text in a numbered list item, and blocksToMarkdownLossy exports 1. <details>. Loading that export back throws, so a document saved as Markdown can no longer be opened.
| Markdown | Result |
|---|---|
1. <details> |
throws |
- [ ] <details> |
throws |
1. <details> followed by indented <summary>s</summary>, body, </details> |
throws |
- <details> |
ok (toggleListItem) |
<details> |
ok (toggleListItem) |
1. text <details> |
ok (numberedListItem) |
1. <div> |
ok (numberedListItem) |
1. <summary> |
ok (numberedListItem) |
markdownToHTML("1. <details>") gives <ol><li><p><details></p></li></ol>. My guess is that the toggle list item's details parse rule matches inside a numbered or check list item and leaves the outer blockContainer with a blockGroup but no blockContent.
What did you expect to happen?
tryParseMarkdownToBlocks returns blocks for any Markdown, keeping what it cannot represent as text. At the least, Markdown that blocksToMarkdownLossy wrote should load again.
Steps to reproduce
Default schema, no extensions:
import { BlockNoteEditor } from "@blocknote/core";
const editor = BlockNoteEditor.create();
// 1. Parsing throws.
editor.tryParseMarkdownToBlocks("1. <details>");
// 2. The editor's own export does not load again.
editor.replaceBlocks(editor.document, [
{ type: "numberedListItem", content: "<details>" },
]);
const markdown = editor.blocksToMarkdownLossy(editor.document); // "1. <details>\n"
editor.tryParseMarkdownToBlocks(markdown); // throws
In an app: type 1. and then <details> in an editor, save the document with blocksToMarkdownLossy, and load it with tryParseMarkdownToBlocks.
BlockNote version
v0.55.0 (also v0.54.0)
Environment
Chromium 151 on macOS 15 with React 19 (v0.54.0), and Node 24 with jsdom 30 (v0.54.0 and v0.55.0). Same error in both.
Additional context
Possibly related to #1711, which reported the same error message for a different input and was closed as working.
- 主要言語
- TypeScript
- スター
- 10.3k
- フォーク
- 777
- 平均マージ
- 2日 22時間
- マージ済み PR(30日)
- 44
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TypeCellOS/BlockNote のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
TypeCellOS/BlockNote#3211 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
TypeCellOS/BlockNote#2949 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
a11y
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
TypeCellOS/BlockNote#2855 ·
メンテナーはふだん 1 日以内に返信
-
a11y
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
TypeCellOS/BlockNote#2829 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Comment thread actions: hover-only controls and unlabeled buttons in ThreadsSideba対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンa11y
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
TypeCellOS/BlockNote#2824 ·
メンテナーはふだん 1 日以内に返信
TypeCellOS/BlockNote の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
radix-ui/primitives#4228 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
SignalK/freeboard-sk#1093 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
[测试] 等待仓库加载后再记录多仓库排序基线対応中かも @myot233 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信