Skip to content

Keep the blank line before a list straight after a table - #182

Merged
krperry merged 1 commit into
mainfrom
fix/table-list-blank-line
Oct 20, 2026
Merged

krperry merged 1 commit into
mainfrom
fix/table-list-blank-line

Conversation

@krperry

@krperry krperry commented Oct 20, 2026

Copy link
Copy Markdown
Collaborator

Problem

Since #181, a list straight after a table lost its blank line, so the footnote under the WC loan table ran straight on from the last row.

Fix

The list's spacing is now cleared only when an empty spacer paragraph (ASM's LWS spacers) came between the table and the list.

  • docx-page-break.lua drops blank paragraphs, so a new filter, docx-empty-paragraph.lua, runs first and keeps them as empty-paragraph markers.
  • FixTableSpacing (MarkTableSpacers) records a marker after a table, then removes all the markers before FixNestedList.

Tests

DocxTableSpacingTest: table then text, table / empty paragraph / text, and an empty paragraph away from a table.

Since PR #181 a list after a table lost its blank line, so the footnote
under the WC loan table ran straight on from the last row. Only clear the
list's spacing when an empty spacer paragraph (ASM's LWS spacers) came
between the table and the list.

docx-page-break.lua drops blank paragraphs, so a new filter,
docx-empty-paragraph.lua, runs first and keeps them as empty-paragraph
markers; MarkTableSpacers records a marker after a table and removes them
all before FixNestedList.
@krperry
krperry merged commit 064d5f6 into main Oct 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant