Repository navigation
Conversation
Word's "List Paragraph" style has no numbering of its own, so a paragraph in that style shows no bullet unless Word numbers it. The list-paragraph-style.lua filter turned every run of these paragraphs into a Pandoc BulletList, so BrailleBlaster put a UEB bullet (_4) at the start of each line. Statements from the Accessible Statement Maker gained about 50 bullets each (LWS) or about 28 (ACBS) that Duxbury and the print do not have. Pandoc already reads paragraphs Word really numbers as BulletList or OrderedList, so the filter only ever saw unnumbered paragraphs: no numPr, numId 0, or a numId not defined in numbering.xml. The filter was added so List Paragraph imports as a list item rather than Body Text. Div() in bbx.lua now does that itself, as a bullet-less 1-3 item like "List" and "List 2", so the filter is removed. Tests build small DOCX files for an unnumbered List Paragraph, numId 0, an undefined numId, and real bullet and decimal numbering. The DOCX builder moves out of PandocDocxPageBreakTest so both tests share it.
A Word paragraph that is numbered and also in a "List" style, such as the "List 2" bullets in the WC statements, arrives from Pandoc as a BulletList item that holds a custom-style Div. bbx.lua writes the bullet into the item and turns the Div into its own one-item list, so the item held a nested list. FixNestedList then moved that list out, which left the bullet (_4) alone on a line and the text on the next line. A bullet could even end a page with its text on the next one. FixNestedList now merges a one-item nested list back into its parent item when the parent holds only the bullet or number. The text follows the bullet in one LIST_ITEM at the nested level, which is the 3-5 layout Duxbury uses for these items. Other nested lists still flatten as before. The test covers a numbered "List 2" paragraph and a bulleted and numbered "List Paragraph".
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.
Two fixes for DOCX list import, found while comparing APH Accessible
Statement Maker files with Duxbury. One commit each.
Stop adding bullets to unnumbered List Paragraphs
Word's "List Paragraph" style has no numbering, so these lines show no
bullet in Word.
list-paragraph-style.luaturned every run of them intoa Pandoc BulletList, so each line got a UEB bullet (
_4): about 50 perLWS statement and 28 per ACBS statement.
Pandoc already reads paragraphs that Word really numbers as
BulletList/OrderedList, so the filter only ever saw unnumbered ones (no
numPr,numId 0, or an undefinednumId). It was added so ListParagraph imports as a list item instead of Body Text, and
Div()inbbx.luanow does that itself. The filter is removed.Keep a list bullet and its text on one line
A paragraph that is numbered and in a "List" style (the "List 2"
bullets in the WC statements) arrives as a bullet item holding a
one-item nested list.
FixNestedListmoved that list out and left thebullet alone on its line. It now merges the text back into the bullet
item when the item holds only its bullet or number, at the nested
level: the 3-5 layout Duxbury uses.
Testing
PandocDocxListStyleTest: unnumbered List Paragraph,numId 0, undefinednumId, real bullet and number, and a numbered"List 2" bullet. A shared
TestDocxbuilder makes the test files.compare_brf.py: bullets added=0 and lone bullets=0 on all problemfiles; BR-83_acbs matches Duxbury. Remaining differences are known,
separate issues (long URL continuation, LWS table headers, rule
lines).
mvnw packagewith tests passes.