Title: id(web/markdown): #3740's alert-marker restore unescapes markers in blockquotes that start with a fence or HTML block — quote_has_content is never marked on the fence/HTML path · Issue #7563 · developing-today/code · GitHub
Open Graph Title: id(web/markdown): #3740's alert-marker restore unescapes markers in blockquotes that start with a fence or HTML block — quote_has_content is never marked on the fence/HTML path · Issue #7563 · developing-today/code
X Title: id(web/markdown): #3740's alert-marker restore unescapes markers in blockquotes that start with a fence or HTML block — quote_has_content is never marked on the fence/HTML path · Issue #7563 · developing-today/code
Description: Finding PR #3740's save-side restore_github_alert_markers only unescapes a GitHub alert marker when it is the first content of its blockquote — its own doc comment: "Markers elsewhere remain ordinary escaped text." The tracking has a hol...
Open Graph Description: Finding PR #3740's save-side restore_github_alert_markers only unescapes a GitHub alert marker when it is the first content of its blockquote — its own doc comment: "Markers elsewhere remain ordina...
X Description: Finding PR #3740's save-side restore_github_alert_markers only unescapes a GitHub alert marker when it is the first content of its blockquote — its own doc comment: "Markers elsewhere rema...
Opengraph URL: https://github.com/developing-today/code/issues/7563
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"id(web/markdown): #3740's alert-marker restore unescapes markers in blockquotes that start with a fence or HTML block — quote_has_content is never marked on the fence/HTML path","articleBody":"## Finding\n\nPR #3740's save-side `restore_github_alert_markers` only unescapes a GitHub alert marker when it is the first content of its blockquote — its own doc comment: \"Markers elsewhere remain ordinary escaped text.\" The tracking has a hole for one first-block shape: when a blockquote's first block is a fenced code block or an HTML block, no line on that path ever marks `quote_has_content`, so the quote still counts as \"empty\" when a later paragraph begins. A standalone escaped marker line there (`\\[\\!NOTE\\]` with a hard break — authored literal text, not an alert) is then unescaped and its hard-break backslash is stripped, silently rewriting authored text on save. The parse side got this right (`preserve_github_alert_marker_breaks` requires the first child to be a Paragraph), and the nested-quote first-block case is handled (content lines mark ancestors) — fence/HTML-first is the unhandled sibling.\n\n## Evidence\n\n- Source PR: #3740 (merged, merge commit `bf26382e60c00db923a57915128d382af4e109be`) — \"Fix #1376: preserve GitHub alert blockquotes\". #1376 is CLOSED; deduped: searches for the function name / fence-first case returned no covering issue.\n- Current main `2aca793a345a88b2f11a815fc190da4df07e0ee0`, `pkgs/id/src/web/markdown.rs`, `restore_github_alert_markers` at `:4254`:\n - The fence-interior branch, the HTML-interior branch, and the fence/HTML opening-line branches all `continue` without touching `quote_has_content` — verified by reading the function top to bottom: `quote_has_content` is written only in the depth-0 reset, the guard reset, and the final marker/content branch.\n - `quote_is_empty` is computed as `!quote_has_content[..=depth].iter().any(...)`, so after a fence-first blockquote the later marker line still sees an \"empty\" quote and is unescaped (with the hard-break suffix stripped).\n- Trace (this run, on the main code): input lines `> ``` `, `> code`, `> ``` `, `>`, `> \\[\\!NOTE\\]\\`, `> Body.` — the three fence lines pass through the fence branches unmarked; the marker line then satisfies `quote_is_empty` and is rewritten to `> [!NOTE]`, losing the authored escape and the hard break.\n- PR #3740's tests pin the neighbouring cases — marker text inside a fence stays verbatim (`test_alert_marker_text_inside_code_fence_is_untouched`), and a nested quote as first block does not make an alert (`test_nested_first_block_does_not_make_alert`) — but no test has a fence or HTML block as the quote's first block followed by a literal marker line.\n\n## Why it matters\n\nThis is the same silent-rewriting class #3740 was written to eliminate, in the one first-block configuration its tests do not cover: a document that quotes a code sample and then writes a literal `[!NOTE]`-looking line loses the escape (and a hard break) on the first save, so the text no longer round-trips as authored.\n\n## Acceptance criteria\n\n- [ ] A blockquote whose first block is a fence or an HTML block counts as having content: a later standalone escaped marker line in it stays escaped, hard break intact.\n- [ ] Genuine alerts (marker as the quote's first content) still restore, and the existing #3740 fixpoint tests still pass.\n- [ ] A regression test pins the fence-first (and ideally HTML-first) blockquote with a following literal marker line as a save fixpoint.\n\n\u003c!-- agent-note:v1\nAgent: pr-diff-review-b\nstate: filed\n-->\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-08T07:44:41Z","url":"https://github.com/developing-today/code/issues/7563"}
| 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:50df4b12-9855-6c52-ce69-3ed063d035ed |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C41E:266D94:23DE72:300FB5:6B074DE3 |
| html-safe-nonce | 3a6bc5dcb3c2905d2d4254401f4b7501fbef2983783509e82aab7492a06df2b6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNDFFOjI2NkQ5NDoyM0RFNzI6MzAwRkI1OjZCMDc0REUzIiwidmlzaXRvcl9pZCI6IjE3Nzk4NjY1NzU2MTM0MTQ4ODMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c966af5a02a7217cbb5dfd099ee1c6f93de2be05fe698c3312e2e95d2fa7a988 |
| hovercard-subject-tag | issue:6268827728 |
| 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/7563/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a1473f014a7f28f8838a6bae7b5c30d8f4af61918ba8e7e8365dedc4eb9a8e05/developing-today/code/issues/7563 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a1473f014a7f28f8838a6bae7b5c30d8f4af61918ba8e7e8365dedc4eb9a8e05/developing-today/code/issues/7563 |
| og:image:alt | Finding PR #3740's save-side restore_github_alert_markers only unescapes a GitHub alert marker when it is the first content of its blockquote — its own doc comment: "Markers elsewhere remain ordina... |
| 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 | 26f151990bcb5b67b87df8b3f96ed340f849939d44e36f348402de5e39cca989 |
| 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 | cd00d8452bcb4e56a60ba7c0e61a697b46513fe9 |
| 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