Third atomic checkpoint of F2.3. Moves the markdown pipe-table
serialize + parse helpers from engine/serialize-markdown.ts to
extensions/table/serialize-markdown.ts:
Moved:
- serializeTableMarkdown(block, renderInline)
- tableMarkdownRow (internal)
- escapeMarkdownTableCell (internal)
- collectTable(lines, startIndex)
- parseTableLine (internal)
- isTableSeparator (internal)
- NEW: buildTableFromMarkdownRows(rows, parseInline) — convenience
for the engine to convert collectTable's raw output into a
WordsTableBlock, keeping the extension free from the engine's
inline parser implementation.
The extension takes inline serialize/parse functions as callback
parameters (`renderInline`, `parseInline`) instead of importing the
engine's inline serializers. Avoids circular dependency — the
extension imports engine for shared types (WordsInline, WordsTableRow)
and factories only, never for runtime function dependencies.
engine/serialize-markdown.ts now imports the 3 extension functions and
calls them from `serializeBlockMarkdown` (write side) and
`parseWordsMarkdown` (parse side). Internal `collectTable`,
`parseTableLine`, `isTableSeparator` removed.
Extension barrel updated to expose the new functions:
- serializeTableMarkdown
- parseTableMarkdownRows (collectTable re-exported under clearer name)
- buildTableFromMarkdownRows
Verification:
- 143/143 tests pass in src/uix/soma/components/words
- 0 new TypeScript errors
F2.3 progress: a + b + d done. Pending: c (serialize-html), e (render),
f (path), g (normalize), h (operations — largest), i (registry
wire-up), j (verify).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>