Skip to content
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

"word-break: break-all" does not seem to work #2267

Open
ondras opened this issue Oct 4, 2024 · 3 comments
Open

"word-break: break-all" does not seem to work #2267

ondras opened this issue Oct 4, 2024 · 3 comments
Labels
bug Existing features not working as expected

Comments

@ondras
Copy link

ondras commented Oct 4, 2024

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:
obrazek

WeasyPrint rendering:
obrazek

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 
@liZe
Copy link
Member

liZe commented Oct 5, 2024

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.

@liZe liZe added the bug Existing features not working as expected label Oct 5, 2024
@liZe
Copy link
Member

liZe commented Oct 5, 2024

(Related to #1153, #1507 and #1534.)

@liZe
Copy link
Member

liZe commented Oct 5, 2024

With word-break: break-all, We should probably set the wrap option earlier:

pango.pango_layout_set_wrap(
layout.layout, PANGO_WRAP_MODE['WRAP_CHAR'])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants