Skip to content

id(web): empty-text links are silently deleted on save — href lost #996

Closed

Description

@dezren39

Bug

In the id web markdown codec (pkgs/id/src/web/markdown.rs), a link with empty text is silently deleted on save — the href is lost entirely.

Evidence (verified this run, main 14dd66b6)

Standalone probe crate compiling the verbatim codec from current main (log: goal hidden_files/probe-2026-10-26-1215/out.log + out3.log):

  • Input: [](https://e.com)\n
    • Parsed PM: {"type":"paragraph"} — no content at all
    • Saved output: "" — the link and its URL are gone
  • Input: before [](https://e.com) after\n
    • Parsed PM: two plain text nodes before / after (no link mark anywhere)
    • Saved output: before after\n (note the double space where the link was)

Root cause, parse side: NodeValue::Link arm (markdown.rs:299) converts a link purely into a mark carried by its child text nodes (collect_inline_children with the link mark pushed). A link with no children produces no text node, so the mark — and the href/title — has nothing to attach to and vanishes. There is no other PM representation for a standalone link in this codec (contrast: images, which are nodes, survive empty alt — [![](img.png)](https://e.com) round-trips fine).

Why it matters

Opening a markdown file containing an empty-text link (a placeholder link, a link inserted by another tool, or one whose text a user cleared in another editor) in id and saving any edit silently destroys the URL. It is unrecoverable from the saved file and invisible in the editor — the paragraph looks unchanged.

Acceptance criteria

  • [](https://e.com) and before [](https://e.com) after survive a parse→save round-trip with the href (and title, when present) preserved, OR the codec takes an explicit, documented alternative (e.g. emitting the href as visible autolink text) — silently dropping it is the one unacceptable outcome; the chosen representation must be a round-trip fixpoint.
  • The editor-side implication is considered: if the chosen PM shape is one the web editor schema cannot represent, say so in the fix and choose the save-side preservation that keeps the file's data.
  • New unit tests in pkgs/id/src/web/markdown.rs cover: empty link alone, empty link mid-paragraph, empty link with a title.
  • Existing codec tests pass; linked-image and normal link cases do not regress.

Related

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    on Oct 26, 2026
  2. developing-today commented on Oct 26, 2026

    @developing-today
    Contributor
  3. added
    queue/queuedHas a queued task in the Supabase agent queue
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 26, 2026
  4. dezren39 commented on Oct 26, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · state: filed

    • Agent: new-issue-creator job
    • Session / ID: new-issue-creator run 2026-10-26T17:10Z (12:10 CDT)
    • Found via: filed this run
    • Task: Empty-text links are silently deleted by the markdown codec on save; verified with a standalone verbatim-codec probe on main 14dd66b, queued for triage (representation choice needed: PM has no standalone link node).
    • Expectation: effort/m — done when the href survives a round-trip (or a documented non-silent alternative lands) with unit tests.
    • Links: probe logs in goal hidden_files/probe-2026-10-26-1215/ (out.log, out3.log)
  5. dezren39 commented on Oct 26, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · picked up

  6. added
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    and removed
    queue/queuedHas a queued task in the Supabase agent queue
    on Oct 26, 2026
  7. 15 remaining items

  8. added
    queue/claimedQueue worker lifecycle state
    and removed
    queue/claimedQueue worker lifecycle state
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 26, 2026
  9. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    Resumed by queue worker (Lane A) — PR #1033 CI is now fully green; verifying diff and merging.

    {"v":1,"kind":"note","state":"in-progress","task_id":1190,"summary":"Resumed task 1190 from awaiting_ci checkpoint (Lane A shift). PR 1033: all status checks SUCCESS incl. test-web-unit, cargo-check, clippy, test-unit shards; diff verified against packet (Link arm empty-children synthesis + text_node_with_marks marks guard + test_empty_link_roundtrips). Merging now.","artifacts":["https://github.com/developing-today/code/pull/1033"],"next":"merge PR 1033, verify issue auto-close, complete task 1190"}
    
  10. added a commit that references this issue on Oct 27, 2026
  11. dezren39 commented on Oct 27, 2026

    @dezren39
    MemberAuthor

    Done — PR #1033 merged (merge commit cf60812); issue auto-closed. All CI checks SUCCESS including test-web-unit with the new test_empty_link_roundtrips.

    {"v":1,"kind":"note","state":"done","task_id":1190,"summary":"PR 1033 merged after full-green CI (test-web-unit, cargo-check, clippy, test-unit shards all SUCCESS). Empty-text links now round-trip in the id web markdown codec; frontend empty-text-node tolerance limitation named in PR body per packet scope.","artifacts":["https://github.com/developing-today/code/pull/1033"],"next":"none — task 1190 complete (fixed_merged)"}
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/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