GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web): unreferenced footnote definitions are silently deleted on save — a definitions-only document saves as an empty file · Issue #1565 · developing-today/code

id(web): unreferenced footnote definitions are silently deleted on save — a definitions-only document saves as an empty file #1565

New issue
Copy link
New issue
Copy link
Closed
#2935
Closed
id(web): unreferenced footnote definitions are silently deleted on save — a definitions-only document saves as an empty file#1565
#2935
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

@dezren39
dezren39
opened on Oct 28, 2026
Issue body actions

Bug

In the id web editor's markdown ↔ ProseMirror codec (pkgs/id/src/web/markdown.rs), a footnote definition that no [^label] reference in the document points at is silently deleted on save:

Hello world.

[^a]: orphan definition

loads and saves as just:

Hello world.

The extreme case is total: a document consisting only of footnote definitions (a shared notes page collecting definitions, or a draft whose references are added later)

[^a]: just a definition

loads as the empty-document placeholder paragraph and saves as an empty file ("").

Definitions that are referenced survive — the codec has dedicated footnote_reference / footnote_definition nodes for them (#945, #1031) and they round-trip. The loss is specifically: any definition whose label no reference in the current document uses. With two definitions where only one is referenced, the referenced one round-trips and the unreferenced one vanishes in the same save.

Verified repro (this run, main db6f7d0)

Standalone probe crate compiling the verbatim pkgs/id/src/web/markdown.rs (md5 8478c0d4fdcb251801a8efc83379f213, identical on sandbox main and the laptop copy) against comrak 0.56 + serde_json, built and run on the laptop (~/git/fleet/probe-2026-10-27-creator-a2 there; logs in the goal's hidden_files/probe-2026-10-27-creator-a2/probe_out3.log):

  • orphan-footnote-def-with-text: "Hello world.\n\n[^a]: orphan definition\n" → PM is a single paragraph Hello world. (the definition appears nowhere) → save returns "Hello world.\n".
  • only-footnote-def: "[^a]: just a definition\n" → PM is {"content":[{"type":"paragraph"}]} (the empty-doc placeholder) → save returns "".
  • two-defs-one-referenced: "text[^a]\n\n[^a]: used\n\n[^b]: unused\n" → PM carries only definition a → save drops [^b]: unused.
  • footnote-def-only-multiline: a two-paragraph unreferenced definition likewise saves as "".
  • Layer isolation: a raw comrak parse_document of "[^a]: just a definition\n" (footnotes extension on, exactly as commonmark_options(), markdown.rs:81-91) yields zero AST children, and "Hello.\n\n[^a]: orphan\n" yields only the Paragraph — comrak never emits a FootnoteDefinition node for an unreferenced definition, so the codec's parse direction (the NodeValue::FootnoteDefinition arm, markdown.rs:559-575) never sees it. The codec inherits the loss from its parser, exactly as id(web): unused link reference definitions are silently deleted on save — a definitions-only document saves as an empty file #1004 does for link reference definitions.

Relation to #1004 (not a duplicate)

#1004 tracks the same phenomenon for link reference definitions ([label]: url), which have no PM representation at all. Footnote definitions are a different construct with a different fix surface: the PM schema and editor already represent them (#945/#1031, and #1347 tracks their editor-schema wiring), referenced definitions already round-trip, and a source pre-scan fix for #1004 would not automatically know about [^label]: definition syntax. This issue tracks the footnote half so neither fix silently leaves the other construct losing data.

Why it matters

Keeping footnote definitions at the foot of a note before (or without) referencing them is a normal authoring pattern, and footnote-heavy documents are exactly the ones this codec added dedicated support for. Opening such a file in the id web editor and saving — even with no edit — destroys every unreferenced definition with no warning. Same silent-loss-on-save family as #996 (empty links) and #1004 (unused reference definitions), in a distinct mechanism.

Suggested direction (triage to decide)

Mirroring #1004's options: (a) preserve unreferenced definitions verbatim — the parse direction would need a source pre-scan for [^label]: definitions, diff them against the labels comrak actually emitted, and carry the leftovers (e.g. as a trailing raw block the editor displays but does not eat); (b) if neither preservation nor a PM representation is acceptable for the unreferenced case, document the limitation in the codec's module docs (top of markdown.rs) so the loss is a known, stated behaviour instead of a silent one. Doing nothing silently is the only unacceptable outcome. If a shared pre-scan lands for #1004, extending it to footnote definitions in the same change would close this issue by reference.

Acceptance criteria

  • A document with an unreferenced footnote definition no longer loses it silently on a load/save round trip — either the definition survives (verbatim or in an equivalent form), or the limitation is explicitly documented in the codec module docs and this issue is closed citing that documentation.
  • Referenced footnote definitions (single- and multi-paragraph, with block children) keep round-tripping exactly as today (id(web): footnotes are backslash-escaped on save — [^1] syntax mangled, definition orphaned #945/id(web): multi-paragraph footnote definitions fuse into one run of text on save — paragraphs concatenated with no separator #1031 behaviour unchanged).
  • A definitions-only document does not save as an empty file under the chosen fix (or is covered by the documented limitation).
  • Round-trip tests for the orphan / mixed referenced+unreferenced / definitions-only cases are added alongside the existing footnote tests in pkgs/id/src/web/markdown.rs.
  • Existing web::markdown tests pass.

Activity

Next
  1. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    on Oct 28, 2026
  2. developing-today commented on Oct 28, 2026

    @developing-today
    developing-todayBot
    on Oct 28, 2026 – with developing.today
    Contributor
    More actions

    CODE-609

  3. dezren39
    added
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/mMedium: expected under 1 day of work
    on Oct 28, 2026
  4. dezren39 commented on Oct 28, 2026

    @dezren39
    dezren39
    on Oct 28, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator (new-issue-creator-code-a)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-10-27 21:05 CDT
    • Found via: filed this run
    • Task: Filed this issue — unreferenced footnote definitions are silently deleted by the id web markdown codec on save (verified verbatim-codec probe on the laptop); queued for triage.
    • Expectation: effort/m — done when the definition survives a load/save round trip (or the limitation is documented in the codec module docs, per the issue's acceptance criteria).
    • Links: queue packet repo-health-code-pilot (triage); related id(web): unused link reference definitions are silently deleted on save — a definitions-only document saves as an empty file #1004 (link reference definitions), id(web): footnotes are backslash-escaped on save — [^1] syntax mangled, definition orphaned #945/id(web): multi-paragraph footnote definitions fuse into one run of text on save — paragraphs concatenated with no separator #1031 (referenced footnotes)
  5. github-actions
    assigned
    dezren39
    on Oct 28, 2026
  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Oct 28, 2026
  7. 346 remaining items

    Load more actions
  8. chatgpt-codex-connector commented on Nov 1, 2026

    @chatgpt-codex-connector
    chatgpt-codex-connectorBot
    on Nov 1, 2026 – with ChatGPT Codex Connector
    More actions

    To use Codex here, create an environment for this repo.

  9. dezren39
    added a commit that references this issue on Nov 1, 2026

    fix(id/web): gate footnote/reference scans on container-relative inde…

    1c762d6
  10. dezren39
    added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    on Nov 1, 2026
  11. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    agent-note:v1 — task 1829 parked (lane A shift, 2026-11-01) for Codex re-review of PR #2935 head 1c762d6. Fix round 29 dispositioned all 8 unresolved P2 threads (replied + resolved): container-relative indentation gates for footnote HTML openings and fence closers, reference-collector footnote state derived from the opening body, multiline labels stop at interrupting blocks, unescaped ( rejected in parenthesized titles, whitespace required after angle destinations, sibling list items end list-scoped fences, space/tab-only blank-line predicate. 8 new regression tests; suite 202 passed / 0 failed on the laptop. Resume: if the re-review is clean, merge PR #2935 and close #1565; if new findings land, fix round 30.

  12. dezren39
    added a commit that references this issue on Nov 1, 2026

    Merge pull request #2935 from developing-today/queue/1829-1565-footno…

    8bcb8d1
  13. dezren39
    closed this as completedin #2935on Nov 1, 2026
  14. developing-today
    added
    status:done
    on Nov 1, 2026
  15. dezren39
    removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    work/assignedQueue worker lifecycle state
    on Nov 1, 2026
  16. dezren39 commented on Nov 1, 2026

    @dezren39
    dezren39
    on Nov 1, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane B
    • Session / ID: queue task 1829 (attempt 3)
    • Found via: queue claim (resume)
    • Task: id(web): unreferenced footnote definitions are silently deleted on save — a definitions-only document saves as an empty file #1565 — preserve unreferenced footnote definitions on save via parse pre-scan (PR id(web): preserve unreferenced footnote definitions on save (#1565) #2935).
    • Outcome: already done — verified fresh this claim. PR id(web): preserve unreferenced footnote definitions on save (#1565) #2935 is MERGED at 2026-11-01T16:50:10Z (merge commit 8bcb8d1e2b9ab7021b606fde64af6f6b77ec88aa, head 1c762d6cb = lane A's fix round 29, which dispositioned all 8 outstanding Codex P2 threads with the web::markdown suite at 202 passed / 0 failed on the laptop), and issue id(web): unreferenced footnote definitions are silently deleted on save — a definitions-only document saves as an empty file #1565 CLOSED at 16:50:11Z on the merge. No code work remained for this attempt; this note plus the label cleanup (stale status/parked / queue/parked / work/assigned from the last park removed) and the queue completion are the closing verbs.
    • Links: PR id(web): preserve unreferenced footnote definitions on save (#1565) #2935
  17. dezren39
    added a commit that references this issue on Nov 11, 2026

    fix(id-web): disposition the five Codex findings on the #1004 preserv…

    b260dc8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.