From 2582843d0f035314843fadf717b000c54ff430c7 Mon Sep 17 00:00:00 2001 From: David Warring Date: Tue, 17 Dec 2024 06:15:09 +1300 Subject: [PATCH] Add token to text grammar --- lib/PDF/Content/Text/Box.rakumod | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/PDF/Content/Text/Box.rakumod b/lib/PDF/Content/Text/Box.rakumod index e147294..1c93ae0 100644 --- a/lib/PDF/Content/Text/Box.rakumod +++ b/lib/PDF/Content/Text/Box.rakumod @@ -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 > | "\c[ZERO WIDTH SPACE]"]+ } - token word { [ > . ]+ '-'? | <[ - \c[HYPHENATION POINT] ]> } + token nbsp { <[ \c[NO-BREAK SPACE] \c[NARROW NO-BREAK SPACE] \c[WORD JOINER] ]> } + token space { [\s > | "\c[ZERO WIDTH SPACE]"]+ } + token hyphen { <[ - \c[HYPHENATION POINT] ]> } + token word { [ . ]+ '-'? | <.hyphen> } } #| break a text string into word and whitespace fragments