Fourth atomic checkpoint of F2.3. Moves the HTML pipe-table serialize +
parse helpers from engine/serialize-html.ts to
extensions/table/serialize-html.ts.
Moved (write side):
- serializeTableHtml(block, serializeInlines, escapeHtmlAttr)
- serializeTableCellHtml (internal)
- tableAttrsHtml (internal)
- tableCellAttrsHtml (internal)
Moved (parse side):
- parseTableHtml(node, parseInlines, textAlignFromStyle)
- collectTableRows (internal)
- htmlRowToWords (internal)
- htmlCellToWords (internal)
- tableCellVerticalAlignFromNode (internal)
- tableCellToneFromNode (internal)
Mirrors the F2.3d pattern: extension consumes engine inline serializer
+ HTML attribute escaper as callback parameters to avoid circular
dependencies. The extension defines its own minimal `WordsTableHtmlElement`
/ `WordsTableHtmlChild` types structurally compatible with the engine's
internal HtmlElementNode/HtmlNode — engine passes its own parsed
nodes via a safe `as unknown as` cast at the call site (commented).
engine/serialize-html.ts now contains only the dispatch call to the
extension's serializeTableHtml / parseTableHtml. ~150 LoC of helper
code removed from the engine; same LoC + clearer separation in
extension.
Extension barrel updated to expose:
- serializeTableHtml / parseTableHtml
- WordsTableHtmlElement / WordsTableHtmlChild types
Verification:
- 143/143 tests pass in src/uix/soma/components/words
- 0 new TypeScript errors
F2.3 progress: a + b + c + d done. Remaining: 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>