Title: id(web): marked spans crossing a soft line break corrupt or fragment on save — single-mark, non-fixpoint · Issue #981 · developing-today/code · GitHub
Open Graph Title: id(web): marked spans crossing a soft line break corrupt or fragment on save — single-mark, non-fixpoint · Issue #981 · developing-today/code
X Title: id(web): marked spans crossing a soft line break corrupt or fragment on save — single-mark, non-fixpoint · Issue #981 · developing-today/code
Description: Summary In the id web editor's markdown ↔ ProseMirror codec (pkgs/id/src/web/markdown.rs), a single-mark span that crosses a soft line break corrupts on save. When a strong/em/strikethrough span wraps across lines in the source file, sav...
Open Graph Description: Summary In the id web editor's markdown ↔ ProseMirror codec (pkgs/id/src/web/markdown.rs), a single-mark span that crosses a soft line break corrupts on save. When a strong/em/strikethrough span wr...
X Description: Summary In the id web editor's markdown ↔ ProseMirror codec (pkgs/id/src/web/markdown.rs), a single-mark span that crosses a soft line break corrupts on save. When a strong/em/strikethrough spa...
Opengraph URL: https://github.com/developing-today/code/issues/981
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(web): marked spans crossing a soft line break corrupt or fragment on save — single-mark, non-fixpoint","articleBody":"## Summary\n\nIn the id web editor's markdown ↔ ProseMirror codec (`pkgs/id/src/web/markdown.rs`), a **single-mark span that crosses a soft line break** corrupts on save. When a strong/em/strikethrough span wraps across lines in the source file, saving multiplies the delimiters, inserts ` ` entities, and the result is **not a fixpoint** — every subsequent save makes it worse. A link spanning a soft break does not corrupt but **fragments** into one link per word, including a link whose entire text is a single space.\n\nThis is distinct from #968: that issue needs *different overlapping* mark sets on adjacent nodes and notes that single-mark cases round-trip cleanly. Here every text node carries the *identical* single mark — the trigger is the soft break inside the span, which is ordinary wrapped prose (any bold sentence longer than one line).\n\n## Evidence (verified this run on main 24261355)\n\nStandalone probe crate compiling the verbatim codec from `pkgs/id/src/web/markdown.rs`, markdown → ProseMirror → markdown, twice (logs: goal workspace `hidden_files/probe-2026-10-26-1015/out2.log`):\n\n| Input | After 1st save | After 2nd save |\n|---|---|---|\n| `**bold\\nmore**` | `**bold**** ****more**` | `**bold**\\*\\* \\***more**` (changes again) |\n| `*em\\nmore*` | `*em** **more*` | `*em*\\* \\**more*` (changes again) |\n| `~~gone\\naway~~` | `~~gone~~~~ ~~~~away~~` | `~~gone\\~\\~\\~\\~ \\~\\~\\~\\~away~~` (changes again) |\n| `[a\\nb](https://e.com \"T\")` | `[a](https://e.com \"T\")[ ](https://e.com \"T\")[b](https://e.com \"T\")` | stable, but fragmented |\n\nThe parse is faithful: `**bold\\nmore**` parses to three text nodes — `bold` [strong], ` ` [strong], `more` [strong]. The middle node comes from the `NodeValue::SoftBreak` arm (markdown.rs:238-241), which emits a standalone `\" \"` text node carrying the active marks. On the emit side that whitespace-only marked node is rendered by `create_marked_text` / `build_mark_chain` (markdown.rs:1117 / :1167) as its own delimited span (`**** ****`), and re-parsing the result creates new mark boundaries — hence the per-save growth. Links take the same path and fragment instead of corrupting.\n\n## Why it matters\n\nWrapped bold/italic/linked text is everywhere in real notes and docs. Opening such a file in the web editor and saving it — even with no edits — rewrites it into entity-escaped, delimiter-doubled text (or a chain of one-word links), and repeated saves compound the damage. Silent data corruption of user documents.\n\n## Suggested directions (either may be sufficient; check both)\n\n- Parse side: fold a soft break into the adjacent text node (append `\" \"` to the previous text node when it carries the same marks) instead of emitting a standalone marked `\" \"` node.\n- Emit side: merge adjacent text nodes with identical mark sets before building the mark chain, and/or never emit a delimited span for a whitespace-only node.\n- Coordinate with #968 — the emit-side half of this may share its fix in `build_mark_chain`; if that fix demonstrably covers these inputs too, close this as a duplicate with a pointer. A fix for #968's listed inputs alone does **not** cover this issue (no nesting here).\n\n## Acceptance criteria\n\n- [ ] `**bold\\nmore**`, `*em\\nmore*`, `~~gone\\naway~~` round-trip open → save to the single-line normalized form (`**bold more**` etc.) with no ` ` and no multiplied delimiters, and a second round-trip is a fixpoint.\n- [ ] `[a\\nb](url)` (with and without title) round-trips as one link, not three.\n- [ ] New unit tests in `pkgs/id/src/web/markdown.rs` cover marked spans crossing soft breaks, including the double round-trip property.\n- [ ] Existing codec tests still pass; #944 / #953 / #968 cases do not regress.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-26T15:18:17Z","url":"https://github.com/developing-today/code/issues/981"}
| 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:63695a76-c2be-c529-4b07-9ce8d5841bcc |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BFFE:1B5128:7B6CF9:A65974:6B063521 |
| html-safe-nonce | d8a6caae3be16ab4335cfcda81c879dd48385d86e97722b623a67958ecf8c60b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRkZFOjFCNTEyODo3QjZDRjk6QTY1OTc0OjZCMDYzNTIxIiwidmlzaXRvcl9pZCI6Ijg4MTg5OTczNzE2Mjg1NjU3OTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 58a5eb7c8de49e25d7b1c29f293d316ec5c80958ab29652183dd5d1b0dc5173f |
| hovercard-subject-tag | issue:6042608997 |
| 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/981/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1067ed35528cb76b5e2e288190d4e0c4ffe9529b9bef8c5f551242b2b61db204/developing-today/code/issues/981 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1067ed35528cb76b5e2e288190d4e0c4ffe9529b9bef8c5f551242b2b61db204/developing-today/code/issues/981 |
| og:image:alt | Summary In the id web editor's markdown ↔ ProseMirror codec (pkgs/id/src/web/markdown.rs), a single-mark span that crosses a soft line break corrupts on save. When a strong/em/strikethrough span wr... |
| 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 | c3584c853cd39700ecff6e2cf8364295ffdb5313e571046c41cd2479270f7df0 |
| 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 | 9eb3bb1597d09170a5f282cd38ae376dee1a5ec1 |
| 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