web: vendored CommonMark subset parser + the markdown vector contract (#531) (#873)
The allowlisted-Markdown foundation: vendor markdown-it 14.3.0 as a single-file ESM bundle, configure it enable-only from the zero preset (emphasis, code, http(s) links, lists, quotes, fences, single-or-double tilde strike), and normalize to a platform-neutral semantic tree. Bare-URL autolinking stays format.js tokenizeText, run over text runs inside the walk — so emphasis spanning a link finally parses. test/event-vectors/markdown.json (66 vectors, mirrored into the iOS fixtures with a byte-identity gate) is the twin contract the native swift-markdown walk will be held to. No consumer changes yet.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
6 files changed,
+8763
−1
ios/LChatCore/Tests/LChatCoreTests/Fixtures/markdown-vector.json+1395 −0package.json+1 −1test/event-vectors/markdown.json+1395 −0test/markdown.test.mjs+131 −0web/static/markdown.js+310 −0web/static/vendor/markdown-it.js+5531 −0
ios/LChatCore/Tests/LChatCoreTests/Fixtures/markdown-vector.jsonLoading diff…
package.jsonLoading diff…
test/event-vectors/markdown.jsonLoading diff…
test/markdown.test.mjsLoading diff…
web/static/markdown.jsLoading diff…
web/static/vendor/markdown-it.jsLoading diff…