Repository navigation
Fix extra blank lines around tables - #181
Merged
Merged
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cursor on the table's last line of braille instead of the blank line
after it, via a new
PageBuilder.findLastContentLine(). Lines after atable now merge with the next block's spacing instead of adding to it.
first row (that comes from the table's own lines before).
FixTableSpacingpandoc fixer, run for DOCX imports: Word tablesadd 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:TableSpacingTestbrailleblaster-core:DocxTableSpacingTest