GeezerVison is showing github.com — id(web): empty-text links are silently deleted on save — href lost · Issue #996 · developing-today/code
id(web): empty-text links are silently deleted on save — href lost #996DescriptionBug
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 — [](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
Activitydeveloping-today commented on Oct 26, 2026 dezren39 commented on Oct 26, 2026 🤖 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)
dezren39 commented on Oct 26, 2026 dezren39 commented on Oct 27, 2026 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"}
dezren39 commented on Oct 27, 2026 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)"}
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|