GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web): a heading containing a hard break is corrupted on save — break becomes a literal backslash and the heading splits into a paragraph · Issue #1388 · developing-today/code

id(web): a heading containing a hard break is corrupted on save — break becomes a literal backslash and the heading splits into a paragraph #1388

New issue
Copy link
New issue
Copy link
Closed
Closed
id(web): a heading containing a hard break is corrupted on save — break becomes a literal backslash and the heading splits into a paragraph#1388
Copy link
Assignees
dezren39
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:done

Description

@dezren39
dezren39
opened on Oct 27, 2026
Issue body actions

Bug: a heading containing a hard break is corrupted on save — break becomes a literal backslash and the rest of the heading splits into a new paragraph

Found in pkgs/id/src/web/markdown.rs (the markdown ⇄ ProseMirror codec), verified this run on main 95bfedb4 with a standalone probe crate carrying a verbatim copy of src/web/markdown.rs (comrak 0.56; probe logs in the goal workspace hidden_files/probe-2026-10-27-creator-a2/out3.log cases setext-hardbreak-backslash / setext-hardbreak-spaces, PM-side case heading-hardbreak in out2.log).

Reproduction (pure markdown in, no editor tricks needed)

A setext heading is a multi-line paragraph, so it can contain a hard break:

Title\
more here
=====

(or the same with two trailing spaces after Title instead of the backslash.)

  1. Parse direction: markdown_to_prosemirror produces one heading node whose inline content is text "Title", hard_break, text "more here" — the parse-side NodeValue::LineBreak arm (markdown.rs:295) emits hard_break regardless of the containing block, and placement validation (markdown.rs:979: "paragraph" | "heading" => child == Placement::Inline) accepts it, since hard_break is inline.

  2. Save direction: the hard_break arm (markdown.rs:1385) builds a comrak NodeValue::LineBreak inside the Heading node built at markdown.rs:1141, and format_commonmark renders it as a backslash + newline inside the ATX heading line:

    # Title\
    more here
    
  3. Re-parsing that saved file yields a different document: a heading whose text is Title\ (a literal backslash character has been added to the user's text) followed by a new plain paragraph more here. The heading the user had is split in two and gains a stray \.

The same PM doc built directly in the editor (e.g. convert a paragraph containing a hard break into a heading — heading in richSchema is inline* content, pkgs/id/web/src/editor.ts:46) corrupts identically.

Why this is a codec bug, not just a renderer quirk

A direct comrak parse → format_commonmark control renders the same bytes (probe out4.log, DIRECT cases) — comrak's renderer cannot spell a line break inside an ATX heading either. But the codec's contract is ProseMirror fidelity (cf. #1031, #1370), and here the PM document itself changes across one open → save cycle. The codec already solves exactly this shape of problem for table cells: #1017's append_table_cell_child (markdown.rs:~1560) degrades a hard/soft break to a single space because "a table cell is single-line content in markdown". A heading is single-line content in markdown for the same reason, and gets no such degradation.

Suggested fix direction (triage decides)

Degrade LineBreak children of a Heading to a space in the save direction (mirroring #1017's table-cell handling), or equivalently normalize them in the parse direction, so a heading with a hard break saves as # Title more here and re-opens as the same single heading. Rejecting with a ConversionError would be worse than the space degradation (it would make the whole document unsavable).

Acceptance criteria

  • Title\ + newline + more here + ===== (and the two-trailing-spaces variant) round-trips to a single heading containing Title more here (or an equivalent single-line spelling) — no literal backslash added, no paragraph split.
  • A hand-built PM heading containing a hard_break saves without corrupting on re-parse; output is a fixpoint.
  • Hard breaks in paragraphs still save as hard breaks (existing behaviour unchanged).
  • Regression test in web::markdown tests next to the id(web): saving a table cell with a hard break or a list panics in the markdown codec — ill-formed comrak AST #1017 table-cell tests; existing codec tests still pass.

Activity

Next
  1. developing-today commented on Oct 27, 2026

    @developing-today
    developing-todayBot
    on Oct 27, 2026 – with developing.today
    Contributor
    More actions

    CODE-481

  2. github-actions
    assigned
    dezren39
    on Oct 27, 2026
  3. dezren39
    added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    task/triageQueue packet kind: verify, reproduce, and route this item
    status/needs-triageNot yet triaged; needs a first look
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    queue/queuedHas a queued queue task
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 27, 2026
  4. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator-code-a
    • Session / ID: new-issue-creator-code-a cron run 2026-10-27 04:43 CDT
    • Found via: filed this run
    • Task: Verified with a standalone probe crate carrying a verbatim copy of src/web/markdown.rs (comrak 0.56) on main 95bfedb (logs hidden_files/probe-2026-10-27-creator-a2/out3.log cases setext-hardbreak-backslash/setext-hardbreak-spaces, out2.log case heading-hardbreak, out4.log DIRECT comrak controls): a setext heading containing a hard break parses to a PM heading with a hard_break child (markdown.rs:295, placement validation :979 accepts it as inline), and the save arm (markdown.rs:1385) builds a comrak LineBreak inside the Heading (built :1141), which format_commonmark renders as '# Title' + newline — re-parsing yields heading text 'Title' (literal backslash added) plus a new paragraph 'more here'. Headings are single-line markdown content but get none of the break degradation id(web): saving a table cell with a hard break or a list panics in the markdown codec — ill-formed comrak AST #1017 built for table cells (append_table_cell_child, markdown.rs:~1560). Enqueued as a triage packet to repo-health-code-pilot — degrade-to-space vs parse-side normalization is a triage decision.
    • Expectation: triage decides the degradation point; done when a heading containing a hard break round-trips as one heading with no added backslash and no split, with a regression test.
    • Links: probe evidence in goal hidden_files (see issue body)
  5. dezren39 commented on Oct 27, 2026

    @dezren39
    dezren39
    on Oct 27, 2026
    MemberAuthor
    More actions

    🤖 Agent note · handed off (duplicate consolidation from #1492)

    • Agent: new-issue-creator (new-issue-creator-code-a, Lane A)
    • Session / ID: cron job new-issue-creator-code-a, run 2026-10-27 13:15 CDT
    • Found via: filed this run (as id(web): a hard_break inside a heading corrupts on save — the heading splits, a literal backslash appears and doubles on the next save; hard_breaks at block ends and in a break-only paragraph are silently dropped #1492, being closed as a duplicate of this issue)
    • Task: transferring the parts of id(web): a hard_break inside a heading corrupts on save — the heading splits, a literal backslash appears and doubles on the next save; hard_breaks at block ends and in a break-only paragraph are silently dropped #1492 that this issue does not yet cover, verified this run on main a1321fd with a verbatim-codec probe crate on the laptop (markdown.rs sha256 f0b6b9cd, comrak 0.56.0; logs hidden_files/probe-2026-10-27-laneA-1315/out2.log + out3.log + out4.log):
      1. Backslash doubling confirmed: PM heading [a, hard_break, b] -> save # a\ + b -> reopen heading text a\ -> second save writes # a\\ (the literal backslash doubles once, then stabilizes). Heading-start placement mirrors it (## \ -> ## \\).
      2. Trailing hard_breaks are silently dropped on save in every container probed: paragraph [text, hard_break] -> saved before; heading [a, hard_break] -> ## a; blockquote paragraph and list-item paragraph trailing breaks likewise (out4.log). No error, no normalization marker.
      3. A paragraph whose only content is a hard_break is deleted outright on save: PM [paragraph [hard_break], paragraph x] -> saved file is x only.
      4. Table-header cells already have an implicit policy (mid-cell break -> space, stable; trailing cell break leaves the table padding non-fixpoint: | a | -> | a |) — the id(web): saving a table cell with a hard break or a list panics in the markdown codec — ill-formed comrak AST #1017 degradation this issue proposes to mirror.
    • Expectation: effort/s — when this issue is triaged, please fold placements 2-3 into the same placement-policy decision (they share the root cause: the save arm at markdown.rs:1385 emits LineBreak with no placement policy); id(web): a hard_break inside a heading corrupts on save — the heading splits, a literal backslash appears and doubles on the next save; hard_breaks at block ends and in a break-only paragraph are silently dropped #1492 is closed as duplicate and its queue task 1528 cancelled so nothing double-books.
    • Links: id(web): a hard_break inside a heading corrupts on save — the heading splits, a literal backslash appears and doubles on the next save; hard_breaks at block ends and in a break-only paragraph are silently dropped #1492 (duplicate, closed); probe ~/git/fleet/probe-2026-10-27-laneA-1315 (laptop)
  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    on Nov 2, 2026
  7. 37 remaining items

  8. dezren39
    added
    queue/blockedQueue or user escalation state
    status/blockedQueue or user escalation state
    user/escalatedRequires a Drew decision or access
    and removed
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    user/reviewNeeds a user-look: Muse reviews first and handles what it can
    on Nov 3, 2026
  9. dezren39 commented on Nov 3, 2026

    @dezren39
    dezren39
    on Nov 3, 2026
    MemberAuthor
    More actions

    🤖 Agent note · blocked / escalated

    • Agent: queue worker (repo-worker-code), lane code-f
    • Session / ID: task 8165
    • Found via: queue claim (attempt 2/4)
    • Task: Update PR fix(id): normalize hard breaks in headings on save #4624 onto main, verify id codec tests, merge (heading hard_break corruption, id(web): a heading containing a hard break is corrupted on save — break becomes a literal backslash and the heading splits into a paragraph #1388). Fresh check 2026-11-03T19:14Z: PR fix(id): normalize hard breaks in headings on save #4624 is OPEN and authored by dezren39 (Drew). Runbook hard stop: never touch a Drew-owned PR — no branch update, test verification on the PR, or merge performed. I reviewed the user/review ask first per protocol; the remaining step is not a content decision I can take, it is ownership of Drew's own PR.
    • Expectation: Drew decision needed: reassign ownership of PR fix(id): normalize hard breaks in headings on save #4624 or authorize another worker to shepherd it. Task 8165 blocked as escalated-to-user with this read attached.
    • Links: PR fix(id): normalize hard breaks in headings on save #4624, issue id(web): a heading containing a hard break is corrupted on save — break becomes a literal backslash and the heading splits into a paragraph #1388
  10. dezren39 commented on Nov 8, 2026

    @dezren39
    dezren39
    on Nov 8, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done (triaged — CONFIRMED live; escalation was a misread; shepherd packet owed under #6838)

    • Agent: queue worker (repo-worker-code), lane code-l
    • Session / ID: task 11941
    • Found via: queue claim · done-task-only verification audit (issue queue: no reconciliation between open issues and queue coverage — non-creator filings never get queue items #7016)
    • Task: Triage the remainder of id(web): a heading containing a hard break is corrupted on save — break becomes a literal backslash and the heading splits into a paragraph #1388 (heading hard_break corrupted on save) — queue-done with no landed evidence.
    • Verdict (fresh state, 2026-11-08): Bug CONFIRMED still live. Current main 801ceb9cb1: pkgs/id/src/web/markdown.rs:5093 still maps hard_break => NodeValue::LineBreak with no heading-side policy (only the id(web): saving a table cell with a hard break or a list panics in the markdown codec — ill-formed comrak AST #1017 table-cell and id(web): edge whitespace in text runs is written on save but stripped on reopen — a whitespace-only paragraph is deleted outright #1420 save-trim policies exist). The fix exists only in PR fix(id): normalize hard breaks in headings on save #4624 (OPEN, head queue/6503-1388-hard-break-heading, no labels; checks: OpenCode metered-provider guard SUCCESS, CodeRabbit SUCCESS — the id test tier has still never run on it).
    • The user/escalated block was a misread — de-escalated by this note. Task 8165 blocked/escalated on 2026-11-03 solely because PR fix(id): normalize hard breaks in headings on save #4624's author is dezren39. That account is the shared fleet GitHub account that authors every queue PR, and PR fix(id): normalize hard breaks in headings on save #4624's head is a queue/* branch from task 6503 — it is not a Drew-owned PR, and it carries no held / user/owned / do-not-merge / do-not-auto-edit labels. Same correction as id: F12.11 delta and binary frames (screen patches, resume tokens) #805 / PR feat(id): resume tokens and bounded screen baselines — #805 Phase 2 #5036 (2026-11-04) and mcpx: tool views and composed tool sets — rename/pin/hide, cross-server namespaces, script-backed tools, and generators that emit declarations #1933 / PR feat(mcpx): toolViews slice 1 — rename/pin/hide on alias views (#1933) #2976 (2026-11-01). Labels updated with this note: user/escalated, queue/blocked, status/blocked, status/triaged removed.
    • Routing — honest state: I cancelled task 8165 (cancel reason records the misread) to clear its block for a fresh shepherd enqueue, then hit the known enqueue trap (fleet-queue (turso): no revive/requeue verb — dead-at-cap tasks can only be reset via direct SQL; enqueue dedupe ignores status #6838): fleet queue enqueue dedupe-hits the cancelled task 8165 under repo-health:v1:pr:developing-today/code:pr:4624 and creates nothing — terminal dedupe hits return the old row instead of reviving it. So no live shepherd task exists right now. The validated shepherd packet is ready at hidden_files/lane-l-2026-11-07/packet-1388-shepherd.json (goal workspace) — enqueue it unchanged when fleet-queue (turso): no revive/requeue verb — dead-at-cap tasks can only be reset via direct SQL; enqueue dedupe ignores status #6838 lands a revive path, or work PR fix(id): normalize hard breaks in headings on save #4624 directly from this note: update onto current main, run the targeted id codec tests (the missing gate), disposition Codex, merge when verified. Do NOT open a competing implementation.
    • Links: PR fix(id): normalize hard breaks in headings on save #4624 fix(id): normalize hard breaks in headings on save #4624 · Enqueue trap fleet-queue (turso): no revive/requeue verb — dead-at-cap tasks can only be reset via direct SQL; enqueue dedupe ignores status #6838 · Audit queue: no reconciliation between open issues and queue coverage — non-creator filings never get queue items #7016
  11. dezren39
    removed
    status/blockedQueue or user escalation state
    user/escalatedRequires a Drew decision or access
    queue/blockedQueue or user escalation state
    status/triagedTriaged and routed (see agent note)
    on Nov 8, 2026
  12. dezren39 commented on Nov 10, 2026

    @dezren39
    dezren39
    on Nov 10, 2026
    MemberAuthor
    More actions

    state: done
    task: 14747
    lane: code-g
    pr: 7947
    outcome: fixed_on_main

    Closing #1388 as fixed on main. The fix — normalize_hard_break_placement / hard_break_is_trailing in pkgs/id/src/web/markdown.rs, with tests for heading mid-break, setext roundtrip, heading edge breaks, paragraph trailing breaks, and break-only paragraphs — was committed as 8625764 and merged via PR #7947 on 2026-11-09 (targeted cargo test -p id --lib hard_break run recorded on task 14168 before merge). Verified fresh 2026-11-10 (task 14747, lane code-g): the function and all five tests are present in current origin/main, and the original PR #4624 carrying the same commit is closed as superseded (git cherry patch-equivalence). Reopen if the corruption reproduces on current main.

  13. dezren39
    closed this as completedon Nov 10, 2026
  14. developing-today
    added
    status:done
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

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:done

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.