Skip to content

Bug: deleting a table's header row corrupts the table on save/reload #15

Closed

Description

@setzor

Summary

  • Deleting the header row of a table silently corrupts the table's structure across save/reload cycles.

Details

Reproduction:

  1. Insert a table (default 2x2 with header row)
  2. Delete the header row using the new "delete row" toolbar button (cursor in header)
  3. Note the entry, switch days, come back

What happens: the serializer writes | | | + separator + body rows. On reload, markdown-it/GFM semantics make the first body row the new header — so a table saved with 1 body row becomes an empty header-only table (| | | + | --- | --- |), and its data row is reinterpreted. Verified with a test: after deleting the header row, the serialized markdown re-loads with the first row's cells as tableHeader.

Expected: either the serializer should not emit a header-less table without a marker, or deleting the header row should convert the next row to a header — either way the round trip must be lossless.

Root cause: serializeTable in src/markdown.ts always writes a | --- | separator after the first row regardless of whether that row is actually a header, and GFM parsing always treats the first row as a header when a separator follows.

Activity

  1. setzor commented on Oct 27, 2026

    @setzor
    OwnerAuthor

    Summary

    Re-verified on current main: this issue no longer reproduces — it is obsolete.

    Details

    The root cause (serializeTable in a src/markdown.ts writing GFM markdown) was removed in commit 2812539 ("Replace Markdown persistence with rich TipTap JSON editing and canvas sketches"). Entries now persist as serialized TipTap JSON documents, so the GFM first-row-is-header reinterpretation can't occur.

    Verified with a round-trip test on current main: insert a 2x2 table with header row → delete the header row → save (editor.getJSON()) → reload into a fresh editor. The table reloads with exactly 1 row of tableCells — no header reinterpretation, no corruption, lossless round trip. (Same verification passed at triage time in PR #47 and again today before closing.)

    Closing as obsolete rather than fixed; no code change needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions