Hyphenation not working when a nbsp is present elsewhere in the word
I am not sure whether this is a bug or feature. See this rendering:
The "x komunikace" is not hyphenated when the space is non-breakable. I would say that it is a bug, because browsers line-break both cases in the same fashion.
I might have fixed this in a PR: https://github.com/Kozea/WeasyPrint/pull/2271
(I have absolutely zero experience with Pango and the underlying line-breaking algorithm in line_break.py is very complex, so please double-check my code.)
Here’s what I get with various browsers. Firefox seems to be the only one to do things right.
Chrome:
Firefox:
Gnome Web:
Here’s what I get with WeasyPrint:
WeasyPrint can break the first word correctly, but not the second one.
Right. The issue is visible when the hyphenation opportunity is in the second word (of the nbsp-joined word pair). This is very typical for Czech typography, where we join a one-letter word with the (longer) following word using a nbsp (as seen in my first post).