eleven / messenger Public

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>
Paul Campbell 8d35e25c420be265cd9cbd3dcddd9aa374da7a45 parent e4c0510
6 files changed, +8763 −1
  • ios/LChatCore/Tests/LChatCoreTests/Fixtures/markdown-vector.json +1395 −0
  • package.json +1 −1
  • test/event-vectors/markdown.json +1395 −0
  • test/markdown.test.mjs +131 −0
  • web/static/markdown.js +310 −0
  • web/static/vendor/markdown-it.js +5531 −0
ios/LChatCore/Tests/LChatCoreTests/Fixtures/markdown-vector.json

Loading diff…

package.json

Loading diff…

test/event-vectors/markdown.json

Loading diff…

test/markdown.test.mjs

Loading diff…

web/static/markdown.js

Loading diff…

web/static/vendor/markdown-it.js

Loading diff…