WeasyPrint
WeasyPrint copied to clipboard
"word-break: break-all" does not seem to work
HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head>
<body>
<style>
p {
width: 320px;
background-color: #eee;
text-align: justify;
word-break: break-all;
}
</style>
<p>Link <a href="#">https://www.w3.org/community/webed/wiki/A_Short_History_of_JavaScript</a> link link.</p>
</body>
</html>
Browser rendering:
WeasyPrint rendering:
Versions:
weasyprint 62.3
libpango-1.0-0:amd64 1.50.12+ds-1
libpangocairo-1.0-0:amd64 1.50.12+ds-1
libpangoft2-1.0-0:amd64 1.50.12+ds-1
Thanks for the report.
You’re right. It’s somehow supported, because it breaks words when it’s obliged to, but it should always break words instead.
(Related to #1153, #1507 and #1534.)
With word-break: break-all, We should probably set the wrap option earlier:
https://github.com/Kozea/WeasyPrint/blob/d0ac723854fa8515be0948ccd803c7594e844c15/weasyprint/text/line_break.py#L478-L479