Skip to content

feat(web): parse markdown into the input model - #727

Open
sbarczyk wants to merge 5 commits into
feat/web-input-serializerfrom
feat/web-input-import
Open

feat(web): parse markdown into the input model#727
sbarczyk wants to merge 5 commits into
feat/web-input-serializerfrom
feat/web-input-import

Conversation

@sbarczyk

@sbarczyk sbarczyk commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Web port of the markdown import, from Kotlin InputParser.kt and InputRemend.kt, cross-checked against iOS:

  • InputRemend closes dangling delimiters before parsing (stack-based scan, link url mode, backslash escapes)
  • InputParser walks the shared md4c AST into plain text plus formatting and block ranges: UTF-16 offsets come from the growing buffer, list depth from AST nesting, and blank-line runs are replayed from the source since md4c collapses them
  • the wasm entry gains a permissiveAutolinks parameter so the input can disable bare-url autolinking like Android does; build.sh now links with em++ (required by current emscripten) and md4c.js is rebuilt
  • round-trip tests on the real parser: canonical documents reproduce byte for byte, dangling forms normalize in one pass, a second pass changes nothing

Jest unit tests included. Stacked on #716.

@sbarczyk sbarczyk changed the title feat/web input import feat(web): parse markdown into the input model Aug 28, 2026
@sbarczyk
sbarczyk marked this pull request as ready for review August 28, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant