GeezerVison is showing github.com — id(web): inline HTML (<sub>/<sup>/<u>/…) is backslash-escaped on save — tags become literal text · Issue #943 · developing-today/code
id(web): inline HTML (<sub>/<sup>/<u>/…) is backslash-escaped on save — tags become literal text #943DescriptionProblem
In the id web editor, any inline HTML in a markdown file other than <img> / <a><img></a> is destroyed on save: the tags come back backslash-escaped as literal text.
Verified probe on main a2eef6f7 (standalone crate compiling the verbatim pkgs/id/src/web/markdown.rs codec from main; full log in the goal's hidden_files probe-2026-10-25-2312/probe2.log):
- Input:
water is H<sub>2</sub>O and x<sup>2</sup>
markdown_to_prosemirror produces plain text nodes "<sub>", "2", "</sub>", …
- Save (
prosemirror_to_markdown) emits: water is H\<sub\>2\</sub\>O and x\<sup\>2\</sup\>
- The rendered document now literally shows
\<sub\> instead of subscript markup.
- Input:
some <u>underlined</u> text → save emits some \<u\>underlined\</u\> text.
Root cause
pkgs/id/src/web/markdown.rs:354 — the NodeValue::HtmlInline arm of convert_node special-cases only img/linked-img tags; every other inline HTML tag falls through to text_node_with_marks(html, active_marks), turning the tag into a plain text node. On save, comrak's CommonMark renderer escapes the </> of text nodes, so the tag can never come back as HTML. Note commonmark_options() (markdown.rs:67) already sets render.unsafe = true for the sized-image HTML forms, so raw inline HTML is not rejected by policy elsewhere in this codec.
Why it matters
<sub>, <sup>, <u>, <kbd>, <mark>, <details> etc. are common in notes and technical docs. Opening such a file in the web editor and saving any unrelated edit silently corrupts every inline HTML tag in the file — the same silent-save-corruption class as #872/#873/#880/#881/#882.
Acceptance criteria
Suggested direction
Carry non-img HtmlInline content through the PM doc in a form the save direction can emit back as a comrak HtmlInline node (instead of a Text node), mirroring how sized images already round-trip via NodeValue::HtmlInline in json_to_ast (markdown.rs:~1027). The editor (TS) side may need a matching node/mark handling note — flag it in the PR if the PM representation changes. Activityadded kind/bugSomething isn't working (prefixed form of the classic bug label) task/triageQueue packet kind: verify, reproduce, and route this item app/idPackage/app: id (pkgs/ or apps/ in this repo) on Oct 26, 2026developing-today commented on Oct 26, 2026 dezren39 commented on Oct 26, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job
- Session / ID: new-issue-creator run, 2026-10-25 23:15 CDT (America/Chicago)
- Found via: filed this run
- Task: HtmlInline arm (markdown.rs:354) turns non-img inline HTML into plain text nodes, so save escapes the tags (
<sub> → \<sub\>). Verified this run with a standalone crate compiling the verbatim codec from main a2eef6f: H<sub>2</sub>O and <u>underlined</u> both round-trip to backslash-escaped literal text (log: goal hidden_files probe-2026-10-25-2312/probe2.log). Queued for the code pilot queue (triage packet — fix needs a representation choice).
- Expectation: effort/m — done looks like inline HTML round-tripping unescaped (or a named benign-tag whitelist), with markdown.rs unit tests.
- Links: n/a yet (queue packet enqueued this run)
dezren39 commented on Oct 26, 2026 dezren39 commented on Oct 26, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|