-
-
Notifications
You must be signed in to change notification settings - Fork 710
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table overflow issue #2325
Comments
Better example:
|
This bug is caused by a dirty workaround that has been hidden since… 2013. WeasyPrint/weasyprint/layout/preferred.py Line 317 in 3c6f9a5
Here, during minimum size calculation, we break the line if we only have a space, because, well, spaces are a very common way to break lines. So:
For example, your sample works without the comma between It only fails with layouts where the minimum size is required (tables and floats for example), but it works for other full-width layouts thanks to the "real" algorithm: WeasyPrint/weasyprint/layout/inline.py Lines 744 to 758 in 3c6f9a5
Just as for this code, we should get track of the letters at tags boundaries to detect possible line breaks correctly, or even reuse the real algorithm, but that would much more complicated, and probably much slower. Or we can just replace the current hack that worked until now by another one that will hopefully work for the next 11 years. |
Yeah, I noticed that this doesn't happen when there's |
This was tested in
WeasyPrint version 62.3
andWeasyPrint version 63.0
.This happens when
overflow-wrap
is set tobreak-word
ornormal
.anywhere
seems to work fine.Input:
Weasyprint PDF rendering:

Firefox rendering:

The text was updated successfully, but these errors were encountered: