Skip to content

Preserve multiline cells and headers in RST grid tables - #87

Open
boyfeiyu wants to merge 1 commit into
thombashi:masterfrom
boyfeiyu:boyf-128-rst-grid-multiline
Open

boyfeiyu wants to merge 1 commit into
thombashi:masterfrom
boyfeiyu:boyf-128-rst-grid-multiline

Conversation

@boyfeiyu

Copy link
Copy Markdown

Grid cells currently flatten string newlines, while an object whose __str__ preserves them can break the table layout. This preserves physical lines in RstGridTableWriter cells and headers, including blank lines and relative indentation for directives, nested lists, and literal blocks. Columns use the longest rendered line, and separators remain between logical rows. Type inference and cell style filters still operate on logical cells.

Related to #32. This covers grid tables; simple and CSV table behavior is unchanged.

Validation:

  • Full suite: 1578 passed, 72 existing xfailed (Python 3.12/macOS).
  • 51 new regression tests, including actual Docutils parsing and HTML checks for the raw-HTML example, nested lists, literal blocks, alignment, style callbacks, cache invalidation, and recovery after write failures.
  • Formatting, changed-file Ruff, Pyright, codespell, package build, and twine check pass.
  • Full Ruff retains the same 129 baseline diagnostics. Sphinx builds with the same 33 baseline warnings.

Docutils is added only to test dependencies.

@boyfeiyu
boyfeiyu force-pushed the boyf-128-rst-grid-multiline branch from 6ed2d2d to cd66c12 Compare November 1, 2026 10:11

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

Labels

None yet

1 participant