Title: id(web): inline code combined with another mark drops the other mark on save — code+link loses the link · Issue #953 · developing-today/code · GitHub
Open Graph Title: id(web): inline code combined with another mark drops the other mark on save — code+link loses the link · Issue #953 · developing-today/code
X Title: id(web): inline code combined with another mark drops the other mark on save — code+link loses the link · Issue #953 · developing-today/code
Description: Problem In the id web editor's markdown codec (pkgs/id/src/web/markdown.rs), inline code combined with any other mark loses the other mark on save. The link case is destructive: a linked code span stops being a link. Evidence (verified t...
Open Graph Description: Problem In the id web editor's markdown codec (pkgs/id/src/web/markdown.rs), inline code combined with any other mark loses the other mark on save. The link case is destructive: a linked code span ...
X Description: Problem In the id web editor's markdown codec (pkgs/id/src/web/markdown.rs), inline code combined with any other mark loses the other mark on save. The link case is destructive: a linked code s...
Opengraph URL: https://github.com/developing-today/code/issues/953
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(web): inline code combined with another mark drops the other mark on save — code+link loses the link","articleBody":"## Problem\n\nIn the id web editor's markdown codec (`pkgs/id/src/web/markdown.rs`), inline code combined with any other mark loses the other mark on save. The link case is destructive: a linked code span stops being a link.\n\n## Evidence (verified this run)\n\nRound-trip probe on main `a2eef6f7` (standalone crate compiling the verbatim `pkgs/id/src/web/markdown.rs` against comrak 0.56.0 + serde_json, `markdown_to_prosemirror` → `prosemirror_to_markdown`; full log in the goal's `hidden_files/probe-2026-10-26-0312/out4.log`):\n\n| Input | PM marks on the text node | Saved output |\n|---|---|---|\n| `` [`code`](https://x.test) `` | `[link(href), code]` | `` `code` `` — **link gone** |\n| `[a `code` b](https://x.test)` | link on all three segments, code additionally on the middle | `[a ](https://x.test)`code`[ b](https://x.test)` — **link fragmented, code segment unlinked** |\n| `` **`code`** `` | `[strong, code]` | `` `code` `` — strong gone |\n| `` *`code`* `` | `[em, code]` | `` `code` `` — em gone |\n| `` ~~`code`~~ `` | `[strikethrough, code]` | `` `code` `` — strikethrough gone |\n| `` `code` `` (control) | `[code]` | `` `code` `` — correct |\n\n## Root cause\n\n`create_marked_text` (`pkgs/id/src/web/markdown.rs:1117`, code-precedence early return at :1122-1130): when a `code` mark is present it returns a bare `NodeValue::Code` node immediately, discarding every other mark in the list instead of wrapping the code node in the remaining mark chain (`build_mark_chain`, :1167). The parse direction preserves the combination correctly (see the PM column above), so this is save-direction only.\n\n## Why it matters\n\nLinked code spans (`` [`api_name`](url) ``) are idiomatic in technical notes — exactly the id editor's home turf. One open + save silently unlinks them and rewrites surrounding links into fragments. Same family as #943/#944/#945 (save-direction codec corruption), distinct mechanism.\n\n## Acceptance criteria\n\n- `` [`code`](https://x.test) `` round-trips open→save with the link intact around the code span.\n- `[a `code` b](https://x.test)` round-trips as one link containing the code segment.\n- `**`code`**`, *`code`*, ~~`code`~~ round-trip with both marks preserved.\n- Plain `` `code` `` and the existing codec tests are unchanged; new unit tests in `pkgs/id/src/web/markdown.rs` cover the code+link and code+strong combinations.\n- Saved output is a stable fixpoint on a second round-trip.\n\n## Suggested fix\n\nIn `create_marked_text`, when the code mark is present, build the `Code` node first and then wrap it in the chain built from the remaining marks (mirroring `build_mark_chain`), instead of returning early. Note the wrapper order must match the non-code path so nesting (e.g. link outside, code inside) renders as `` [`code`](href) ``.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-26T08:26:59Z","url":"https://github.com/developing-today/code/issues/953"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7df48f83-d140-6366-9861-be5c594f6245 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E9F4:F286:4EBED0:672DAD:6B061E94 |
| html-safe-nonce | 710b47f8c6a25e3bc9236934d6a1cfe8032576f7b03432673f4a94e023d88efe |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUY0OkYyODY6NEVCRUQwOjY3MkRBRDo2QjA2MUU5NCIsInZpc2l0b3JfaWQiOiIxNDI2NTE5NTEzMDkyMjAyMTMyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | ca231652873f9779bb6e1c0a13024308b08e32c7443bcac156719aed6d4edf60 |
| hovercard-subject-tag | issue:6036058623 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/953/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e198fe4481ac0357518e447ad777b76d92be2eca6554b5084bc2881c1200332e/developing-today/code/issues/953 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e198fe4481ac0357518e447ad777b76d92be2eca6554b5084bc2881c1200332e/developing-today/code/issues/953 |
| og:image:alt | Problem In the id web editor's markdown codec (pkgs/id/src/web/markdown.rs), inline code combined with any other mark loses the other mark on save. The link case is destructive: a linked code span ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9a7c5824b75ea2ec5e3de73a483229c7bb9f32a774ffd401f010dd9bacf1483d |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | b25c3080e84402f75431d8dc7a96b2635219cec7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width