Preserve table sections through rich text saves

What does this MR do and why?

Preserve declared table sections during rich-text saves, fixing lost sorting after editing HTML tables.

  • Retain header, body, and footer row groups.
  • Keep inserted and pasted rows in the body.
  • Preserve merged-cell layout when a rowspan crosses row groups.
  • Leave unsupported complex tables intact instead of dropping content during enhancement.
  • Keep single-cell copying compatible with section wrappers.

Scope: HTML/Markdown normalization still occurs. This preserves table semantics, not byte-for-byte source formatting. The reported historical content loss was not reproduced; inspecting the original description versions did not establish its cause.

References

Screenshots or screen recordings

Before After
Table loses sorting after a rich-text save Saved table retains descending sorting and its content

How to set up and validate locally

  1. Enable Feature.enable(:markdown_sortable_table_columns) in the Rails console.
  2. Save the issue's HTML sample in a wiki page using plain-text mode.
  3. Reopen in rich text, append ZZTEST to the first cell, and save.
  4. Reopen, edit again, and save directly from rich text.
  5. Confirm all markers and the details block remain. Sort the rendered table in both directions.

Observed: all 12 markers, one details block, and three sortable headers survive repeated saves. Before the fix, the sample loses its header section and sorting controls.

MR acceptance checklist

Evaluated against the MR acceptance checklist.

Edited by Vanessa Otto

Merge request reports

Loading
Loading