Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions src/LineBreak.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ export const BREAK_ALLOWED = '÷';
export const UnicodeTrie = createTrieFromBase64(base64, byteLength);

const ALPHABETICS = [AL, HL];
const ALPHABETICS_OR_NU = ALPHABETICS.concat(NU)
const HARD_LINE_BREAKS = [BK, CR, LF, NL];
const SPACE = [SP, ZW];
const PREFIX_POSTFIX = [PR, PO];
Expand Down Expand Up @@ -484,10 +485,10 @@ const _lineBreakAtIndex = (

// LB30 Do not break between letters, numbers, or ordinary symbols and opening or closing parentheses.
if (
(ALPHABETICS.concat(NU).indexOf(current) !== -1 &&
(ALPHABETICS_OR_NU.indexOf(current) !== -1 &&
next === OP &&
ea_OP.indexOf(codePoints[afterIndex]) === -1) ||
(ALPHABETICS.concat(NU).indexOf(next) !== -1 && current === CP)
(ALPHABETICS_OR_NU.indexOf(next) !== -1 && current === CP)
) {
return BREAK_NOT_ALLOWED;
}
Expand Down