Skip to content

Fix extra blank lines around tables - #181

Merged
krperry merged 1 commit into
mainfrom
fix/table-blank-lines
Oct 19, 2026
Merged

krperry merged 1 commit into
mainfrom
fix/table-blank-lines

Conversation

@krperry

@krperry krperry commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Table formatters (simple, listed, linear, stairstep) now leave the
    cursor on the table's last line of braille instead of the blank line
    after it, via a new PageBuilder.findLastContentLine(). Lines after a
    table now merge with the next block's spacing instead of adding to it.
  • A headings-only simple table stays on its last line.
  • A listed table adds a blank line between rows only, not before the
    first row (that comes from the table's own lines before).
  • New FixTableSpacing pandoc fixer, run for DOCX imports: Word tables
    add no blank lines of their own, so the table, its UTD copy and any
    adjacent lists get one line before/after. Only a heading next to the
    table keeps its spacing, matching Duxbury.

Tests

  • utd: TableSpacingTest
  • brailleblaster-core: DocxTableSpacingTest

Table formatters left the cursor on the blank line after the table, so
the lines after it were counted from there and added to the spacing of
the next block. They now leave the cursor on the table's last line of
braille, through a new PageBuilder.findLastContentLine, so the spacing
merges with the block next to it. A headings-only simple table stays on
its last line, and a listed table no longer adds a blank line before
its first row, only between rows.

Word tables add no blank lines of their own. A new FixTableSpacing
fixer, run for DOCX imports, sets the table, its UTD copy and any
adjacent lists to one line before and after, so only a heading next to
the table keeps its spacing, matching Duxbury.

Add TableSpacingTest in utd and DocxTableSpacingTest in core.
@krperry
krperry merged commit 1179b4d into main Oct 19, 2026
2 checks passed
mwhapples pushed a commit to mwhapples/BrailleBlaster-NG that referenced this pull request Oct 28, 2026
Since PR aphtech#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.
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