docs/plans/2026-03-14-phase-4-markdown-execution.md
Complete the phase-4 markdown slice only. Add high-ROI non-React logic coverage for parser and serializer helpers plus incomplete-MDX fallback behavior.
markdownToSlateNodesSafely behavior specsmarkdown already has broad deserializer/serializer coverage, but several helper seams are still only covered indirectly.stripMarkdown*parseAttributes / propsToAttributestagRemarkPlugin / getRemarkPluginsWithoutMdxgetCustomMarkmarkdownToSlateNodesSafelymarkdownToSlateNodesSafely currently drops already-parsed content when the last complete block is void and the input ends with incomplete MDX. Example probe: "<hr /><u>" returns only a paragraph with "<u>", losing the horizontal rule.task.mdc, testing.mdc, planning-with-files, tdd, and changeset guidance.markdownToSlateNodesSafely output with a temporary Bun script to identify public behavior and confirm a likely fallback bug.stripMarkdown*parseAttributes / propsToAttributestagRemarkPlugin / getRemarkPluginsWithoutMdxgetCustomMarkmarkdownToSlateNodesSafely suite covering:
markdownToSlateNodesSafely so incomplete-MDX fallback appends a new paragraph after a complete void block instead of dropping the already-parsed node.@platejs/markdown.bun test packages/markdown/src/lib/deserializer/utils/stripMarkdown.spec.ts packages/markdown/src/lib/rules/utils/parseAttributes.spec.ts packages/markdown/src/lib/utils/getRemarkPluginsWithoutMdx.spec.ts packages/markdown/src/lib/serializer/utils/getCustomMark.spec.ts packages/markdown/src/lib/deserializer/utils/markdownToSlateNodesSafely.spec.tsxbun test packages/markdown/srcbun run test:slowest -- --top 15 packages/markdown/srcpnpm installpnpm turbo build --filter=./packages/markdown
rolldown / Node 20.12.1 with ERR_INVALID_ARG_VALUE from node:util.styleTextNO_COLOR=1 pnpm turbo build --filter=./packages/markdown
pnpm lint:fixbun test packages/markdown/src (post-lint rerun)package reality: markdownToSlateNodesSafely had a real content-loss bug on the incomplete-MDX fallback path when the fully parsed prefix ended in a void node.package reality: the safe fallback should preserve complete parsed output and append the fallback paragraph, not replace the whole result set.verification blocker: package build is currently blocked outside slice scope by a rolldown + Node 20.12.1 styleText call that passes ['underline', 'gray'] where Node expects a single format string.