Skip to content

Commit

Permalink
Add <hyphen> token to text grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
dwarring committed Dec 16, 2024
1 parent 1103a60 commit 2582843
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/PDF/Content/Text/Box.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ method content-height returns Numeric { @!lines».height.sum * $.leading; }
=para Calculated from the number of lines in the text box.
my grammar Text {
token nbsp { <[ \c[NO-BREAK SPACE] \c[NARROW NO-BREAK SPACE] \c[WORD JOINER] ]> }
token space { [\s <!after <nbsp> > | "\c[ZERO WIDTH SPACE]"]+ }
token word { [ <![ - \c[HYPHENATION POINT] ]> <!before <space>> . ]+ '-'? | <[ - \c[HYPHENATION POINT] ]> }
token nbsp { <[ \c[NO-BREAK SPACE] \c[NARROW NO-BREAK SPACE] \c[WORD JOINER] ]> }
token space { [\s <!after <nbsp> > | "\c[ZERO WIDTH SPACE]"]+ }
token hyphen { <[ - \c[HYPHENATION POINT] ]> }
token word { [ <!hyphen> <!space> . ]+ '-'? | <.hyphen> }
}

#| break a text string into word and whitespace fragments
Expand Down

0 comments on commit 2582843

Please sign in to comment.