Create a new Markdown component that compiles markdown source directly into a Neo.mjs VDOM tree, bypassing innerHTML and the marked library.
Architecture:
- Input: Markdown string (or stream).
- Output: Pure VDOM Tree (e.g.,
{tag: 'p', cn: [{vtype: 'text', html: 'Hello'}]}).
- Parser: A lightweight, custom parser running in the App Worker.
Benefits:
- Delta Updates: Enables fine-grained DOM patching for streaming content (LLM responses).
- Security: Eliminates XSS risks associated with
innerHTML.
- Performance: Avoids full DOM trashing on every character append.