Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Rewrite the line breaking algorithm #301
Line breaking currently relies on Pango. That's bad, because (1) Pango is not aware of the CSS-specific rules, and (2) the current implementation always allows line breaking when a tag is open or close.
Many reported bugs rely on this feature. But unfortunately, implementing a real line breaking algorithm needs right-to-left and bidi (see #106).
As ::first-letter depends on white space handling, we must create the box after collapsing spaces, not during the build of the box tree. This commit makes WeasyPrint pass most of the W3C tests related to first-letter (and never crash). Known problems left include: - list markers are considered as the first letter, - lines may break between the first letter and the rest of the text (see #163 and #301), - the CSS attributes are all kept, some should probably be removed (the spec doesn't give a whole list). Even if W3C tests makes me quite confident (some of them are crazy), tests must be added in WeasyPrint too.