— is rewritten on sa...
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(web): HTML blocks (comments, \u003cdetails>, \u003cdiv>) are rewritten as ```html code blocks on save","articleBody":"## Summary\n\nIn the id web editor's markdown ↔ ProseMirror codec (`pkgs/id/src/web/markdown.rs`), any **HTML block** in a markdown file — an HTML comment, a `\u003cdetails>` collapsible, a `\u003cdiv>` — is rewritten on save as a fenced ```` ```html ```` code block. The rendered document changes completely: invisible comments become visible code blocks, and collapsible sections break into two code fences with their body stranded between them.\n\n## Evidence (verified this run on main 24261355)\n\nStandalone probe crate compiling the verbatim codec from `pkgs/id/src/web/markdown.rs` (logs: goal workspace `hidden_files/probe-2026-10-26-1015/out.log` + `out2.log`):\n\nInput:\n```\n\u003c!-- note: draft -->\n\ntext\n```\nAfter one save:\n````\n```html\n\u003c!-- note: draft -->\n```\n\ntext\n````\n\nInput:\n```\n\u003cdetails>\n\u003csummary>More\u003c/summary>\n\nbody\n\u003c/details>\n```\nAfter one save: the `\u003cdetails>…\u003c/summary>` chunk and the closing `\u003c/details>` each become separate ```` ```html ```` fences with `body` as a plain paragraph between them — the collapsible is destroyed.\n\n## Root cause\n\n- Parse side: the `NodeValue::HtmlBlock` arm (markdown.rs:329-352) converts non-`\u003cimg>` HTML blocks to a `code_block` with `attrs.params = \"html\"` (comment in code: \"safe fallback\").\n- Emit side: the `code_block` arm in `json_to_ast` (markdown.rs:872) has no special case for that marker — it always builds a fenced `NodeValue::CodeBlock`, so the fallback becomes permanent in the saved file.\n\n## Design note (why this is triage, not a small fix)\n\nThe PM shape for a converted HTML block (`code_block`, params `html`) is indistinguishable from a user-authored ```` ```html ```` block, which parses via `NodeValue::CodeBlock` with info `html` into the same shape. Emitting raw HTML for every params=`html` code block would corrupt genuinely authored html code blocks (they would turn into live HTML). A fix needs a way to tell the two apart — e.g. a distinct marker attr or node type for converted HTML blocks, with a migration story for documents already saved in the ambiguous shape — or another faithful-preservation design.\n\nRelated but distinct: #943 covers *inline* HTML being backslash-escaped; this issue is block-level HTML only.\n\n## Why it matters\n\nHTML comments and `\u003cdetails>` blocks are common in notes, READMEs, and docs the web editor opens. A no-edit save currently vandalizes them into visible code fences. Until a faithful round-trip exists, opening such a file in the editor is destructive.\n\n## Acceptance criteria\n\n- [ ] A design is chosen that distinguishes converted HTML blocks from authored ```` ```html ```` code blocks (or otherwise preserves both faithfully), and is recorded on this issue.\n- [ ] `\u003c!-- comment -->`, `\u003cdetails>…\u003c/details>`, and a bare `\u003cdiv>` block each round-trip open → save byte-identical, and a second round-trip is a fixpoint.\n- [ ] A user-authored ```` ```html ```` fenced block still round-trips as a fenced code block.\n- [ ] New unit tests in `pkgs/id/src/web/markdown.rs` cover HTML-block round-trips (comment, details, div, authored html fence).\n- [ ] Existing codec tests still pass; the sized/linked `\u003cimg>` HTML-block handling (markdown.rs:332-340, #893) does not regress.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-26T15:19:28Z","url":"https://github.com/developing-today/code/issues/982"}
| 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:548c7ec2-80b9-bf9e-c835-019378ddbc6d |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D4D6:3422CF:AF04BF:E1B88A:6B0638B6 |
| html-safe-nonce | c1d9550f1609a827d754224f09ec87bfa9713e7db9abdbad0bc13a9375a43313 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEQ2OjM0MjJDRjpBRjA0QkY6RTFCODhBOjZCMDYzOEI2IiwidmlzaXRvcl9pZCI6IjM1OTU5Nzg2NjE5MDk5MDM1NDIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 473e7f2fad33fdc7222850c25ef5f6124113ba8deac8731b885bbf816d4349f8 |
| hovercard-subject-tag | issue:6042629875 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | ///voltron/issues_fragments/issue_layout |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/982/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c8d3308c79861e76b3c24dc59779c443137d7105348145c239bc52cb50b4463f/developing-today/code/issues/982 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c8d3308c79861e76b3c24dc59779c443137d7105348145c239bc52cb50b4463f/developing-today/code/issues/982 |
| og:image:alt | Summary In the id web editor's markdown ↔ ProseMirror codec (pkgs/id/src/web/markdown.rs), any HTML block in a markdown file — an HTML comment, a collapsible, a — is rewritten on sa... |
| 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 | dcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297 |
| 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 | 0f38f5735226749ec5e08a8649dce4cb2613d9ad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
| Skip to content | https://github.com/developing-today/code/issues/982#start-of-content |
| https://github.com/ |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F982 |
| GitHubRepository hosting, code review, and collaboration | https://github.com/platform |
| CopilotAI coding agent for tasks, projects, and automated work | https://github.com/features/copilot |
| ActionsCI/CD and automation | https://github.com/features/actions |
| Code QualityQuality analysis, fixes, and enforcement | https://github.com/features/code-quality |
| CodespacesCloud development environments | https://github.com/features/codespaces |
| Code SecurityVulnerability detection and remediation | https://github.com/security/advanced-security/code-security |
| Secret ProtectionSecret scanning and leak prevention | https://github.com/security/advanced-security/secret-protection |
| All Features | https://github.com/features |
| Documentation | https://docs.github.com/en |
| Training | https://learn.github.com/skills |
| Certifications | https://learn.github.com/credentials |
| Build with Copilot | https://github.com/features/ai |
| Customize Copilot | https://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview |
| Integrations | https://github.com/marketplace |
| Trending repos | https://github.com/trending |
| GitHub Sponsors | https://github.com/open-source/sponsors |
| Developer articles | https://github.com/resources/articles |
| ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place. | https://github.blog/changelog/ |
| Enterprises | https://github.com/enterprise |
| Team | https://github.com/team |
| Startups | https://github.com/enterprise/startups |
| Nonprofits | https://github.com/solutions/industry/nonprofits |
| Healthcare | https://github.com/solutions/industry/healthcare |
| Financial services | https://github.com/solutions/industry/financial-services |
| Manufacturing | https://github.com/solutions/industry/manufacturing |
| Government | https://github.com/solutions/industry/government |
| See all industries | https://github.com/solutions/industry |
| Why GitHub | https://github.com/why-github |
| Customer Stories | https://github.com/customer-stories |
| Business insights | https://github.com/solutions/executive-insights |
| Trust Center | https://github.com/trust-center |
| GitHub Advanced SecurityEnterprise-grade code security | https://github.com/security/advanced-security |
| Copilot for businessEnterprise-grade AI features | https://github.com/features/copilot/copilot-business |
| Premium SupportEnterprise-grade 24/7 support | https://github.com/enterprise/premium-support |
| Documentation | https://docs.github.com/en |
| Resource center | https://github.com/resources |
| Blog | https://github.blog/ |
| Events & webinars | https://github.com/resources/events |
| Community Forum | https://github.com/orgs/community/discussions |
| Customer Stories | https://github.com/customer-stories |
| Integrations | https://github.com/marketplace |
| Customer support | https://help.github.com/ |
| Training | https://learn.github.com/skills |
| GitHub Status | https://www.githubstatus.com/ |
| About | https://github.com/about |
| Partners | https://github.com/partners |
| Changelog | https://github.blog/changelog/ |
| GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub. | https://githubuniverse.com/ |
| Pricing | https://github.com/pricing |
| Sign in | https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdeveloping-today%2Fcode%2Fissues%2F982 |
| Sign up | https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=developing-today%2Fcode |
| Reload | https://github.com/developing-today/code/issues/982 |
| Reload | https://github.com/developing-today/code/issues/982 |
| Reload | https://github.com/developing-today/code/issues/982 |
| developing-today | https://github.com/developing-today |
| code | https://github.com/developing-today/code |
| Code | https://github.com/developing-today/code |
| Issues1.1k (1.1k) | https://github.com/developing-today/code/issues |
| Pull requests159 (159) | https://github.com/developing-today/code/pulls |
| Discussions | https://github.com/developing-today/code/discussions |
| Actions | https://github.com/developing-today/code/actions |
| Projects | https://github.com/developing-today/code/projects |
| Wiki | https://github.com/developing-today/code/wiki |
| Security and quality | https://github.com/developing-today/code/security |
| Insights | https://github.com/developing-today/code/insights |
| https://github.com/developing-today/code |
| New issue | https://github.com/login?return_to=https://github.com/developing-today/code/issues/982 |
| New issue | https://github.com/login?return_to=https://github.com/developing-today/code/issues/982 |
| #1024 | https://github.com/developing-today/code/pull/1024 |
id(web): HTML blocks (comments, , ) are rewritten as ```html code blocks on save | https://github.com/developing-today/code/issues/982#top |
| #1024 | https://github.com/developing-today/code/pull/1024 |
| https://github.com/dezren39 |
| app/id | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fid%22 |
| kind/bug | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22 |
| priority/normal | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Fnormal%22 |
| source/creator | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fcreator%22 |
| status:done | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%3Adone%22 |
| task/triage | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22 |
| https://github.com/dezren39 |
| dezren39 | https://github.com/dezren39 |
| on Oct 26, 2026 | https://github.com/developing-today/code/issues/982#issue-6042629875 |
| 2426135 | https://github.com/developing-today/code/commit/24261355092d8510398c356e284d7b9050a44913 |
| #943 | https://github.com/developing-today/code/issues/943 |
id(web): sized linked images still lose their href on reload — PR #888's HTML emission has no parse counterpart (and editor parseDOM drops the wrapping link) #893 | https://github.com/developing-today/code/issues/893 |
| Next | https://github.com/developing-today/code/issues/982?timeline_page=1 |
| https://github.com/apps/developing-today |
| developing-today | https://github.com/apps/developing-today |
| on Oct 26, 2026 | https://github.com/developing-today/code/issues/982#issuecomment-6419746871 |
| developing.today | https://kaneo.security.cab |
| CODE-167 | https://kaneo.security.cab/dashboard/workspace/6oQgIkST0YGrCcxrnhbHPOUCfgdD3cqE/project/pfcq432h349r20up18gttfv4/task/vtv8r6q5w2jnzlz58gnw6ryo |
| dezren39 | https://github.com/dezren39 |
| queue/queued | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22 |
| source/creator | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fcreator%22 |
| task/triage | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22 |
| status/needs-triage | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22 |
| priority/normal | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Fnormal%22 |
| app/id | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fid%22 |
| kind/bug | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22 |
| on Oct 26, 2026 | https://github.com/developing-today/code/issues/982#event-34274275225 |
| https://github.com/dezren39 |
| dezren39 | https://github.com/dezren39 |
| on Oct 26, 2026 | https://github.com/developing-today/code/issues/982#issuecomment-6419751347 |
| 2426135 | https://github.com/developing-today/code/commit/24261355092d8510398c356e284d7b9050a44913 |
| github-actions | https://github.com/apps/github-actions |
| dezren39 | https://github.com/dezren39 |
| on Oct 26, 2026 | https://github.com/developing-today/code/issues/982#event-34274388718 |
| dezren39 | https://github.com/dezren39 |
| work/assigned | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22 |
| queue/claimed | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22 |
| status/in-progress | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22 |
| status/needs-triage | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fneeds-triage%22 |
| queue/queued | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fqueued%22 |
| on Oct 26, 2026 | https://github.com/developing-today/code/issues/982#event-34301631285 |
| https://github.com/dezren39 |
| dezren39 | https://github.com/dezren39 |
| on Oct 26, 2026 | https://github.com/developing-today/code/issues/982#issuecomment-6429819094 |
| fix(id-web): preserve HTML blocks on save via code_block provenance attr (#982) #1024 | https://github.com/developing-today/code/pull/1024 |
| fix(id-web): preserve HTML blocks on save via code_block provenance attr (#982) #1024 | https://github.com/developing-today/code/pull/1024 |
id(web): HTML blocks (comments, , ) are rewritten as ```html code blocks on save #982 | https://github.com/developing-today/code/issues/982 |
| fix(id-web): preserve HTML blocks on save via code_block provenance attr (#982) #1024 | https://github.com/developing-today/code/pull/1024 |
| dezren39 | https://github.com/dezren39 |
| queue/claimed | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22 |
| status/in-progress | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22 |
| status/parked | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fparked%22 |
| queue/parked | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fparked%22 |
| on Oct 27, 2026 | https://github.com/developing-today/code/issues/982#event-34328513479 |
| https://github.com/dezren39 |
| dezren39 | https://github.com/dezren39 |
| on Oct 27, 2026 | https://github.com/developing-today/code/issues/982#issuecomment-6433243698 |
| fix(id-web): preserve HTML blocks on save via code_block provenance attr (#982) #1024 | https://github.com/developing-today/code/pull/1024 |
| fix(id-web): preserve HTML blocks on save via code_block provenance attr (#982) #1024 | https://github.com/developing-today/code/pull/1024 |
| dezren39 | https://github.com/dezren39 |
| on Oct 27, 2026 | https://github.com/developing-today/code/issues/982#event-34328577742 |
| fix(id-web): preserve HTML blocks on save via code_block provenance a… | https://github.com/developing-today/code/commit/ce1acfb4d61acf2d7fa77eaee4e3a1e64c9e943f |
| ce1acfb | https://github.com/developing-today/code/commit/ce1acfb4d61acf2d7fa77eaee4e3a1e64c9e943f |
| dezren39 | https://github.com/dezren39 |
| completed | https://github.com/developing-today/code/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted |
| #1024 | https://github.com/developing-today/code/pull/1024 |
| on Oct 27, 2026 | https://github.com/developing-today/code/issues/982#event-34328577981 |
| developing-today | https://github.com/apps/developing-today |
| status:done | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%3Adone%22 |
| status:in-review | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%3Ain-review%22 |
| on Oct 27, 2026 | https://github.com/developing-today/code/issues/982#event-34328583343 |
| dezren39 | https://github.com/dezren39 |
| status/in-progress | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%2Fin-progress%22 |
| queue/claimed | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22queue%2Fclaimed%22 |
| work/assigned | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22work%2Fassigned%22 |
| on Oct 27, 2026 | https://github.com/developing-today/code/issues/982#event-34328603094 |
| https://github.com/dezren39 |
| dezren39 | https://github.com/dezren39 |
| on Oct 27, 2026 | https://github.com/developing-today/code/issues/982#issuecomment-6433266563 |
| fix(id-web): preserve HTML blocks on save via code_block provenance attr (#982) #1024 | https://github.com/developing-today/code/pull/1024 |
| ce1acfb | https://github.com/developing-today/code/commit/ce1acfb4d61acf2d7fa77eaee4e3a1e64c9e943f |
| fix(id-web): preserve HTML blocks on save via code_block provenance attr (#982) #1024 | https://github.com/developing-today/code/pull/1024 |
| dezren39 | https://github.com/dezren39 |
| on Nov 17, 2026 | https://github.com/developing-today/code/issues/982#event-36373049949 |
| pm-dashboard-backup: monthly generations kept 12 months (#10299) (#11012 | https://github.com/developing-today/code/commit/6f18b607e479bcd593e795429eef4deb82d08aac |
| #10299 | https://github.com/developing-today/code/issues/10299 |
| #11012 | https://github.com/developing-today/code/pull/11012 |
| 6f18b60 | https://github.com/developing-today/code/commit/6f18b607e479bcd593e795429eef4deb82d08aac |
| Sign up for free | https://github.com/signup?return_to=https://github.com/developing-today/code/issues/982 |
| Sign in to comment | https://github.com/login?return_to=https://github.com/developing-today/code/issues/982 |
| dezren39 | https://github.com/dezren39 |
| app/id | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22app%2Fid%22 |
| kind/bug | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22kind%2Fbug%22 |
| priority/normal | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22priority%2Fnormal%22 |
| source/creator | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22source%2Fcreator%22 |
| status:done | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22status%3Adone%22 |
| task/triage | https://github.com/developing-today/code/issues?q=state%3Aopen%20label%3A%22task%2Ftriage%22 |
|
| https://github.com |
| Terms | https://docs.github.com/site-policy/github-terms/github-terms-of-service |
| Privacy | https://docs.github.com/site-policy/privacy-policies/github-privacy-statement |
| Security | https://github.com/security |
| Status | https://www.githubstatus.com/ |
| Community | https://github.community/ |
| Docs | https://docs.github.com/ |
| Contact | https://support.github.com?tags=dotcom-footer |
.