Repository navigation
Closed
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)Package/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)source/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Description
Problem
Markdown footnotes in a file opened in the id web editor are mangled on save: the footnote syntax is backslash-escaped into literal text.
Verified probe on main a2eef6f7 (standalone crate compiling the verbatim pkgs/id/src/web/markdown.rs codec from main; log in the goal's hidden_files probe-2026-10-25-2312/probe2.log):
- Input:
Text with a note.[^1] [^1]: The footnote body. markdown_to_prosemirrortreats both the reference and the definition as ordinary paragraph text (footnotes never parse as footnotes).- Save (
prosemirror_to_markdown) emits:TheText with a note.\[^1\] \[^1\]: The footnote body.\[escapes mean the saved file no longer contains a footnote at all — it renders as literal[^1]characters, and the definition paragraph is orphaned plain text.
Root cause
commonmark_options()(pkgs/id/src/web/markdown.rs:67) enables strikethrough, tasklist and table extensions but notoptions.extension.footnotes, so comrak parses[^1]as plain text, and its CommonMark renderer escapes the brackets of text nodes on save.- Simply enabling the extension is not a fix by itself: the
convert_nodearm at markdown.rs:467 explicitly mapsFootnoteDefinition/FootnoteReferencetojson!(null)— footnotes would then be silently deleted on open instead of mangled on save. The ProseMirror schema has no footnote node, so a representation decision is required (e.g. carry reference + definition as preserved raw text that re-emits verbatim, as sized images are carried through HTML forms).
Why it matters
Footnotes are standard in longer notes/docs. Today, opening a footnoted file in the web editor and saving any edit destroys every footnote in it — silently, and in a way that is hard to notice in a diff. Same silent-save-corruption class as #872/#873/#880/#881/#882.
Acceptance criteria
- A markdown file with at least one footnote reference + definition round-trips open → save with the footnote still functioning as a footnote in the saved markdown (reference and definition both intact, not escaped, not deleted).
- No regression to the currently passing codec tests; the strikethrough/tasklist/table extensions behave as before.
- New unit tests in
pkgs/id/src/web/markdown.rscover the footnote round-trip, including a definition with more than one paragraph if the chosen representation supports it (otherwise the limitation is named in the PR). - If the chosen fix is "preserve verbatim as raw text", a re-open of the saved file must show the same preserved form (stable fixpoint, no progressive escaping).
Metadata
Metadata
Assignees
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)Package/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)Something isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)Ordinary priority (the default)source/creatorFiled by the new-issue-creator jobFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this itemQueue packet kind: verify, reproduce, and route this item
Activity
developing-today commentedon Oct 26, 2026
CODE-157
dezren39 commentedon Oct 26, 2026
🤖 Agent note · filed
16 remaining items
dezren39 commentedon Oct 26, 2026
🤖 Agent note · parked
queue/1144-945-footnotes(8977b06) · probe logshidden_files/probe-2026-10-26-1552-t1144/crate/out.logdezren39 commentedon Oct 26, 2026
🤖 Agent note · picked up
queue/1144-945-footnotesfix(id-web): preserve footnotes in markdown codec (#945) (#1013)
dezren39 commentedon Oct 26, 2026
🤖 Agent note · done
fix(id): footnote_definition save arm compiles + legacy test asserts …