-
-
Notifications
You must be signed in to change notification settings - Fork 659
Closed
Description
Description
When using tryParseMarkdownToBlocks() to parse markdown content containing numbered lists, BlockNote throws a RangeError: No value supplied for attribute start error.
Error Stack Trace
RangeError: No value supplied for attribute start
computeAttrs index.js:2051
computeAttrs index.js:2167
create index.js:2180
enter index.js:3042
addElementByRule index.js:2939
addElement index.js:2884
addDOM index.js:2792
Minimal Reproduction
import { useCreateBlockNote } from "@blocknote/react";
const editor = useCreateBlockNote();
const markdown = \`
1. First item
2. Second item
3. Third item
\`;
// This throws RangeError
const blocks = await editor.tryParseMarkdownToBlocks(markdown);Root Cause Analysis
Based on investigation, the issue appears to be a schema mismatch:
- BlockNote's `numberedListItem` schema requires a `start` attribute
- The prosemirror-markdown parser provides an `order` attribute instead
- When ProseMirror tries to create the node, it fails because `start` is required but not supplied
Expected Behavior
Numbered lists should parse correctly without errors.
Actual Behavior
Parser throws `RangeError: No value supplied for attribute start`.
Workaround
Convert numbered lists to bullet lists before parsing:
const preprocessedContent = markdown.replace(/^(\s*)\d+\.\s/gm, "\$1* ");
const blocks = await editor.tryParseMarkdownToBlocks(preprocessedContent);Environment
- BlockNote version: 0.41.1, 0.44.0
- React version: 19
- Browser: Firefox & Chrome
- OS: Linux
Related Issues
- editor.markdownToBlocks parse incorrectly #226 - editor.markdownToBlocks parse incorrectly
- MD parser broken #1711 - MD parser broken
tryParseMarkdownToBlocksnot parsing checklists #826 - tryParseMarkdownToBlocks not parsing checklists
Metadata
Metadata
Assignees
Labels
No labels