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): saving a table cell with a hard break or a list panics in the markdown codec — ill-formed comrak AST · Issue #1017 · developing-today/code

id(web): saving a table cell with a hard break or a list panics in the markdown codec — ill-formed comrak AST #1017

New issue
Copy link
New issue
Copy link
Closed
#1021
Closed
id(web): saving a table cell with a hard break or a list panics in the markdown codec — ill-formed comrak AST#1017
#1021
Copy link
Assignees
dezren39
Labels
app/idPackage/app: id (pkgs/ or apps/ in this repo)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

Description

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

Summary

Saving a document whose table cell contains anything other than plain paragraph text can panic in the markdown codec: prosemirror_to_markdown builds an ill-formed comrak AST and format_commonmark panics instead of returning markdown (or an error).

Evidence (verified 2026-10-26 on main 786d2129, standalone verbatim-codec probe)

Probe: hidden_files/probe-2026-10-26-1615/ (crate = current pkgs/id/src/web/markdown.rs copied verbatim + round-trip harness).

Case 1 — a hard_break inside a table cell (PM JSON: table → table_row → table_cell → paragraph → text line1, hard_break, text line2):

thread 'main' panicked at comrak-0.56.0/src/cm.rs:29:9:
The document to format is ill-formed: InvalidChildType {
  parent: <TableCell> [<Text("line1")>, <LineBreak>, <Text("line2")>],
  child: <LineBreak> }

Case 2 — a bullet_list inside a table cell: same panic, InvalidChildType { parent: <TableCell>, child: <List …> }.

Root cause

pkgs/id/src/web/markdown.rs:1090-1110 (json_to_ast, table-cell special case): paragraph children are unwrapped inline into the cell, and any non-paragraph child is also appended directly to the cell node via append_inline_child (:1106) — including block nodes (lists, code blocks, quotes). hard_break maps to NodeValue::LineBreak (:1074), which comrak's CommonMark renderer also rejects as a direct child of TableCell. comrak validates the tree in format_commonmark and panics on the ill-formed AST; the codec returns Result<_, ConversionError> everywhere else, so this input escapes the error channel entirely. In the server this is a panic on the save path for a document the editor can plausibly produce (Shift+Enter inside a cell; pasted/structured content with a list in a cell).

Related, already tracked separately: multi-paragraph cells fuse words (#1003) — that is the paragraph-unwrap path; this issue is the non-paragraph / LineBreak path that crashes outright.

Acceptance criteria

  • prosemirror_to_markdown never panics for any PM doc the schema can express in a table cell; ill-supported cell content degrades to a defined representation (e.g. hard break → space or literal text; block content → flattened inline text) or returns ConversionError.
  • Regression tests in pkgs/id/src/web/markdown.rs covering at least: hard_break in a cell, list in a cell, code_block in a cell — each asserting a non-panicking, content-preserving-as-possible output and a stable second save (fixpoint).
  • Existing markdown codec tests still pass.

Suggested direction

In the table-cell special case, sanitize children before appending: convert LineBreak to a space/text node inside cells, and flatten non-inline block children to their inline text (or reject with ConversionError::UnknownType-style error) instead of attaching them under TableCell.

Activity

Next
  1. 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
    on Oct 26, 2026
  2. developing-today commented on Oct 26, 2026

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

    CODE-179

  3. dezren39
    added
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    on Oct 26, 2026
  4. github-actions
    assigned
    dezren39
    on Oct 26, 2026
  5. dezren39 commented on Oct 26, 2026

    @dezren39
    dezren39
    on Oct 26, 2026
    MemberAuthor
    More actions

    🤖 Agent note · filed

    • Agent: new-issue-creator job
    • Session / ID: new-issue-creator cron run 2026-10-26 16:10 CDT
    • Found via: filed this run
    • Task: Verified with a standalone verbatim-codec probe on main 786d212 (logs hidden_files/probe-2026-10-26-1615/err.log + err2.log): PM table cells containing a hard_break or a bullet_list make prosemirror_to_markdown build an ill-formed comrak AST (LineBreak / List directly under TableCell, json_to_ast cell special case markdown.rs:1090-1110) and format_commonmark panics at comrak cm.rs:29 instead of returning markdown or an error. Enqueued as a triage packet to repo-health-code-pilot — the degradation choice for unsupported cell content needs a decision.
    • Expectation: triage decides the cell-content degradation rule; done when no PM cell content can panic the save path and regression tests cover hard_break/list/code_block cells.
    • Links: probe evidence in goal hidden_files (see issue body)
  6. dezren39
    added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status/needs-triageNot yet triaged; needs a first look
    queue/queuedHas a queued queue task
    on Oct 26, 2026
  7. 5 remaining items

  8. dezren39
    removed
    queue/claimedQueue worker lifecycle state
    on Oct 26, 2026
  9. dezren39 commented on Oct 26, 2026

    @dezren39
    dezren39
    on Oct 26, 2026
    MemberAuthor
    More actions

    🤖 Agent note · parked

    • Agent: queue worker (repo-worker-code), lane A shift
    • Session / ID: queue task 1180
    • Found via: queue claim
    • Task: Parked awaiting CI on PR fix(id-web): degrade unsupported table-cell content instead of panicking on save (#1017) #1021 (table-cell degradation fix for the save panic). Fix is implemented and probe-verified (pre-fix panic reproduced; post-fix all cases convert with fixpoints); CI was 7 pass / 20 pending / 0 fail at park time.
    • Expectation: resume = merge PR fix(id-web): degrade unsupported table-cell content instead of panicking on save (#1017) #1021 when CI is green, verify id(web): saving a table cell with a hard break or a list panics in the markdown codec — ill-formed comrak AST #1017 auto-closes, complete the task.
    • Links: PR fix(id-web): degrade unsupported table-cell content instead of panicking on save (#1017) #1021 · branch queue/1180-1017-table-cell-panic (f32a41e) · probe logs hidden_files/probe-2026-10-26-1627-t1180/
  10. dezren39 commented on Oct 26, 2026

    @dezren39
    dezren39
    on Oct 26, 2026
    MemberAuthor
    More actions

    🤖 Agent note · picked up

    • Agent: queue worker (repo-worker-code), lane B shift
    • Session / ID: queue task 1180, run 2026-10-26T21:53Z (resumed from park)
    • Found via: queue claim (repo-health-code-pilot)
    • Task: Resume 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 panic fix: PR fix(id-web): degrade unsupported table-cell content instead of panicking on save (#1017) #1021 was parked awaiting CI (7 pass / 20 pending / 0 fail at park time).
    • Expectation: effort/xs — fresh check at pickup: all 28 PR checks PASS, head still f32a41e; merging per standing criteria, then verifying id(web): saving a table cell with a hard break or a list panics in the markdown codec — ill-formed comrak AST #1017 auto-closes and completing the task.
    • Links: PR fix(id-web): degrade unsupported table-cell content instead of panicking on save (#1017) #1021 · branch queue/1180-1017-table-cell-panic
  11. dezren39
    added
    queue/claimedQueue worker lifecycle state
    status/in-progressQueue worker lifecycle state
    and removed
    status:in-review
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    on Oct 26, 2026
  12. dezren39
    added a commit that references this issue on Oct 26, 2026

    fix(id-web): degrade unsupported table-cell content instead of panick…

    97cf446
  13. dezren39
    closed this as completedin #1021on Oct 26, 2026
  14. developing-today
    added
    status:done
    on Oct 26, 2026
  15. dezren39 commented on Oct 26, 2026

    @dezren39
    dezren39
    on Oct 26, 2026
    MemberAuthor
    More actions

    🤖 Agent note · done

    • Agent: queue worker (repo-worker-code), lane B shift
    • Session / ID: queue task 1180, run 2026-10-26T21:53Z
    • Found via: queue claim (repo-health-code-pilot)
    • Task: Table-cell hard_break/list panic on save — PR fix(id-web): degrade unsupported table-cell content instead of panicking on save (#1017) #1021 degrades unsupported table-cell content instead of building an ill-formed comrak AST.
    • Expectation: met — on resume, all 28 PR checks passed; merged PR fix(id-web): degrade unsupported table-cell content instead of panicking on save (#1017) #1021 (squash, merge commit 97cf446); this issue auto-closed by the merge.
    • Links: PR fix(id-web): degrade unsupported table-cell content instead of panicking on save (#1017) #1021 (merged)
  16. dezren39
    removed
    status/in-progressQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    work/assignedQueue worker lifecycle state
    on Oct 26, 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)kind/bugSomething isn't working (prefixed form of the classic bug label)priority/normalOrdinary priority (the default)source/creatorFiled by the new-issue-creator jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

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.