GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — id(web): emphasis/strong/strikethrough wrapping an image are silently dropped on save — mixed text+image spans split and leak   entities · Issue #1407 · developing-today/code Closed Labels app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours 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:in-reviewtask/small-fixQueue packet kind: bounded fix with reproduction and targeted tests DescriptionSummaryIn pkgs/id's web markdown codec, a mark that wraps an image (emphasis, strong, strikethrough) is silently lost. When the mark wraps only an image, it disappears entirely; when it wraps text plus an image, the saved markdown splits the mark around the image and leaks literal Evidence (verified this run on main
|
| Input | Saved output |
|---|---|
** |
 — emphasis gone |
**** |
 — strong gone |
~~~~ |
 — strikethrough gone |
*[](https://e.com)* |
[](https://e.com) — link survives, emphasis gone |
*text  tail* |
*text ** tail* — one emphasis span becomes two, with literal   entities in the saved file, and the image is no longer inside either span's text (re-parse gives the same split PM, so it is stable corruption, not a fixpoint error) |
**text  tail** |
**text **** tail** — same for strong |
- ** item |
-  item — same loss inside list items |
Control: *text only* round-trips exactly. The parsed ProseMirror for ** is a bare image node with no marks at all ({"type":"image","attrs":{"alt":"alt","src":"/x.png"}}).
NodeValue::Image arm in convert_node (pkgs/id/src/web/markdown.rs:354-393) receives the surrounding marks in active_marks but only carries the link mark forward, copying it into the image node's linkHref/linkTitle attrs (the id(web): linked images [](href) lose their link in the markdown ↔ ProseMirror codec — save strips the href #880 precedent). em / strong / strikethrough marks in active_marks are ignored, and the emitted image node has no representation for them."image" arm of json_to_ast (pkgs/id/src/web/markdown.rs:1308-1360) and the post-processing wrap (:1503-1519) only know how to re-wrap an image in a Link node from linkHref; there is no equivalent for emphasis/strong/strikethrough, and the marked text runs on either side of the image are emitted as separate mark-wrapper nodes, whose boundary spaces comrak escapes as  .Italic/bold captions and callouts that include an inline image are ordinary markdown (common in notes imported from other tools, which id syncs as plain files). Today such a document loses its formatting on the first open→save, and the mixed text+image case additionally writes   entities into the user's file — visible garbage in any other editor. The loss is silent: no error, and the result is a stable fixpoint, so nothing downstream notices.
**, ****, ~~~~ and the linked-image form *[](href)* round-trip with the mark preserved (exact markdown or an equivalent form that re-parses to the same marked structure, with no mark loss).*text  tail* (and the strong/strikethrough equivalents) save as a single emphasis span containing the image, with no   or other HTML entities introduced into the saved markdown.linkHref/linkTitle pattern for wrapping an image, and the editor either renders it or the limitation is explicitly documented in the issue's resolution.pkgs/id/src/web/markdown.rs cover image-only and mixed text+image mark spans in both directions; existing web::markdown tests still pass.Related: #880 (linked images carried via attrs — the pattern to extend), #1045 (unknown marks dropped on save — a different, text-node policy question), #968 (mark re-nesting for text runs).
🤖 Agent note · state: filed
🤖 Agent note · picked up
🤖 Agent note · picked up
🤖 Agent note · done