Skip to content

tables: typescript and heading cell fixes - #9298

Open
mejo- wants to merge 4 commits into
mainfrom
fix/paste_multiline_header_cells
Open

mejo- wants to merge 4 commits into
mainfrom
fix/paste_multiline_header_cells

Conversation

@mejo-

@mejo- mejo- commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

馃摑 Summary

Best reviewed commit by commit.

馃弫 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests

馃 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

Assisted-by: ClaudeCode:claude-opus-5.5
Signed-off-by: Jonas <jonas@freesources.org>
Table cells are serialized one by one with `serializer.serialize()`,
which renders the children of the node it is given. Body cells hold
paragraphs, which render their inline content with marks. Header cells
hold inline content directly, so their text nodes were rendered without
marks. Bold, italic, code and links in table headers were dropped when
the document was saved.

Serialize header cells through their own `toMarkdown()`, which renders
the inline content with marks. It skips escaping of block syntax at the
start of the line (e.g. `#`), because header cells are parsed as inline
content.

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5.5
Markdown table headers cannot span multiple lines, but pasting
multi-line text into a header cell inserted hard breaks. These were
saved as a multi-line header row. When the document was loaded again,
the header's paragraph did not fit the inline-only header cell, so the
parser put the rest of the table into a new cell. The nested-table
filter then rejected the whole document, and it stayed empty in view
mode.

Flatten content pasted into a header cell to a single line: join
paragraphs, list items and hard breaks with spaces, keeping marks and
other inline nodes.

Also unwrap paragraphs in header cells when parsing, so documents that
already contain a multi-line header load again, with the lines joined.

Fixes: #9297

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5.5
Only the first pipe character per line of a cell was escaped when
serializing tables, because the regular expression lacked the global
flag. A cell containing `a|b|c` was saved as `a\|b|c`. On reload the
unescaped pipe split the cell into an extra column.

Signed-off-by: Jonas <jonas@freesources.org>
Assisted-by: ClaudeCode:claude-opus-5.5
@mejo- mejo- self-assigned this Sep 29, 2026
@mejo- mejo- added bug Something isn't working 3. to review feature: tables labels Sep 29, 2026
@mejo-

mejo- commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

/backport to stable35

This branch has not been deployed

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

Projects

Status: 馃憖 In review

Development

Successfully merging this pull request may close these issues.

Multiline table header cells make the whole page disappear in view mode

1 participant