Commit a40eab9
feat: replace unified.js ecosystem with custom markdown parser/serializer
Replace the remark/rehype/unified pipeline (~89 transitive packages) with two
custom, zero-dependency files for markdown↔HTML conversion. The unified ecosystem
was overkill for BlockNote's bounded feature set and required 6 custom plugins
to work around its abstractions.
New files:
- markdownToHtml.ts: block tokenizer + inline parser with recursive list handling
- htmlToMarkdown.ts: DOM-based serializer with proper list nesting and table support
Removes 12 direct dependencies: unified, remark-parse, remark-stringify, remark-gfm,
remark-rehype, rehype-parse, rehype-stringify, rehype-remark, rehype-format,
hast-util-from-dom, unist-util-visit, @types/hast
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 38be5fd commit a40eab9
263 files changed
Lines changed: 12014 additions & 904 deletions
File tree
- packages
- core
- src/api
- exporters/markdown
- util
- parsers
- html/util
- __snapshots__
- markdown
- xl-ai
- tests/src/unit
- core/formatConversion
- exportParseEquality
- __snapshots__/markdown/markdown
- export
- __snapshots__
- blocknoteHTML
- audio
- complex
- heading
- image
- link
- lists
- paragraph
- quote
- style
- table
- video
- html
- audio
- complex
- heading
- image
- link
- lists
- paragraph
- quote
- style
- table
- video
- markdown
- audio
- complex
- heading
- image
- link
- lists
- paragraph
- quote
- style
- table
- video
- nodes
- audio
- complex
- heading
- image
- link
- lists
- paragraph
- quote
- style
- table
- video
- parse
- __snapshots__/markdown
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
111 | 110 | | |
112 | 111 | | |
113 | 112 | | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | 116 | | |
128 | 117 | | |
129 | 118 | | |
130 | 119 | | |
131 | 120 | | |
132 | 121 | | |
133 | 122 | | |
134 | | - | |
135 | 123 | | |
136 | 124 | | |
137 | 125 | | |
| |||
0 commit comments