Files
deckcraft/crates
xmaks82andМагда М.Г. 5fb694d991 Text: a word doesn't break after ?, !, } or + (URLs wrap as in PowerPoint) (#924)
* Text: a word doesn't break after ?, !, } or + (URLs wrap as in PowerPoint)

Unicode line breaking allows a break after ?, !, } and + inside a word,
so a long URL broke after its '?' and after each '+' of a query and left
the rest of the line empty. Measured in PowerPoint 2016 for Windows with
latinLnBrk off (its default), none of them is a break: the word fills the
line and breaks where it no longer fits, as PowerPoint already does after
/ and \ (break_opportunities). The same synthetic slide now wraps line for
line as PowerPoint's PDF does, a Yandex search URL included.

* Text tests: the first line doesn't end at the separator

* Text tests: check the line is full, not that it avoids ending at a separator

* Keep the Unicode break after ?, !, / outside Latin words

The PowerPoint no-break rule only holds inside a word: before an ideograph
(日本!語) or punctuation the Unicode break stays, as CodeRabbit pointed out.

* Only letters and digits continue a word for the no-break rule

AL and AI also hold symbols such as & and ×, so a!&b kept no break after !.
is_word_char now also requires c.is_alphanumeric() (CodeRabbit).

* Test that Latin before CJK and a separator before a space still break

---------

Co-authored-by: Магда М.Г. <mail@mgmagda.ru>
2026-11-01 10:54:32 +01:00
..
2026-10-28 06:02:27 +00:00
2026-10-25 13:42:04 -04:00
2026-10-30 15:48:33 -04:00
2026-10-30 20:13:00 -07:00
2026-10-30 15:42:30 -04:00
2026-10-31 00:56:34 -04:00
2026-10-31 00:56:34 -04:00
2026-10-28 06:02:27 +00:00