Repository navigation
Divide long UEB strings with the continuation indicator - #177
Merged
Merged
Conversation
When an unspaced string such as a URL was longer than a whole line,
PageBuilder cut it at the end of the line and carried on at the start
of the next. Nothing marked the division, and it could fall inside a
word, so "personal-banking.html" read "p]sonal-bank" / "+4html".
UEB marks such a division with the line continuation indicator, dot 5
(" in ASCII braille), at the end of the line. LineWrapper gains a
divideLongWord hook; by default it returns null and keeps the old
cut. The new UebLineWrapper divides at the last natural point that
fits with room for the indicator: after a slash or hyphen, or before
a dot or an at sign. Failing that, it takes the last place that keeps
a prefix cell with its cell and a number sign with its digits. Text
with spaces, or Unicode text that is not Braille cells, keeps the old
cut.
PageBuilder uses UebLineWrapper for literary text only when the main
table is UEB, so EBAE, Spanish and the other codes are unchanged, and
math keeps its own wrapper. A string that fits whole on the next line
still moves there.
FormattingTest.longWordLineWrapTest runs UEB with a 45-cell unspaced
string, so it now expects the division before the dot with the
indicator.
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.
When an unspaced string such as a URL is longer than a whole line,
BrailleBlaster cut it at the end of the line with nothing to mark the
division, sometimes inside a word ("p]sonal-bank" / "+4html"). UEB
requires the line continuation indicator, dot 5 (
"), at the end ofeach line that divides such a string.
Changes (utd)
LineWrappergains adivideLongWordhook. The default returnsnull and keeps the old cut.
UebLineWrapperdivides at the last natural point that fitswith room for the indicator: after
_/or a hyphen, or before a dot(
4) or@a. Failing that, it takes the last place that keeps aprefix cell with its cell and a number sign with its digits. Spaced
text, and Unicode text that isn't Braille cells, keep the old cut.
PageBuilderusesUebLineWrapperfor literary text only when themain table is UEB. EBAE, Spanish, Cherokee and the others are
unchanged, and math keeps its own wrapper.
BrailleBlaster still moves a long URL to a new line before dividing
it, so its division points differ from Duxbury's, which starts the
URL on the current line.
Testing
UebLineWrapperTest: division at a slash and before a dot, notinside a word; prefixes and numbers kept whole; a string that fits
on the next line moves without the indicator; a URL over three
lines; non-UEB tables unchanged; spaced text not divided.
FormattingTest.longWordLineWrapTestnow expects the UEB divisionwith the indicator.
check_continuation.py: all 6 continuation statements pass. BR-102and BR-78 now show the indicator, and every page fits 40 cells by
25 lines.
baseline only by the bullet removal from Fix List Paragraph bullets and lone list bullets in DOCX import #176.
mvnw packagewith tests passes.