Skip to content

[stable35] tables: typescript and heading cell fixes - #9384

Merged
mejo- merged 4 commits into
stable35from
backport/9298/stable35
Oct 15, 2026
Merged

mejo- merged 4 commits into
stable35from
backport/9298/stable35

Conversation

@backportbot

@backportbot backportbot Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Backport of #9298

Warning, This backport's changes differ from the original and might be incomplete 鈿狅笍

Todo

  • Review and resolve any conflicts
  • Review and verify the backported changes
  • Amend HEAD commit to remove the line stating to skip CI

Learn more about backports at https://docs.nextcloud.com/server/stable/go.php?to=developer-backports.

@backportbot
backportbot Bot requested review from max-nextcloud and mejo- October 13, 2026 14:10
@backportbot backportbot Bot added bug Something isn't working 3. to review feature: tables labels Oct 13, 2026
@backportbot backportbot Bot added this to the Nextcloud 35.0.2 milestone Oct 13, 2026
@backportbot backportbot Bot added bug Something isn't working 3. to review feature: tables labels Oct 13, 2026
mejo- added 4 commits October 14, 2026 12:30
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- force-pushed the backport/9298/stable35 branch from 07c626e to 6aac479 Compare October 14, 2026 10:31
@mejo-
mejo- marked this pull request as ready for review October 14, 2026 10:32
@mejo-
mejo- requested a review from silverkszlo as a code owner October 14, 2026 10:32
@mejo-
mejo- merged commit 0ae5072 into stable35 Oct 15, 2026
76 of 79 checks passed
@mejo-
mejo- deleted the backport/9298/stable35 branch October 15, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants