-
-
Notifications
You must be signed in to change notification settings - Fork 686
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
Spurious line breaks on tag borders at margin boundaries #163
Comments
This is a known bug (although it wasn’t filed on GitHub yet). Fixing probably requires a non-trivial amount of refactoring in the inline layout code. :/ |
I'll keep my fingers crossed. :-) In the meantime, as a crude workaround, I've been setting |
Would it be feasible for someone to provide guidance on addressing this issue? I might be interested. The workaround hasn't worked for me; I've had to set an explicit width, additionally. Perhaps there's a way to merely detect this issue in Python? |
Line breaking happens in Another approach could be to "flatten" the tree of inlines and find break opportunities independently of tag boundaries. It would make a lot of things easier, but it’s more work up front for a big refactor. |
I'm not sure that it's realistic, for me to tackle the latter suggestion, considering how involved that appears to be. In that case, though - do you have an idea of how you would restore the inline elements after flattening the tree [to make line breaking more accurate]? Perhaps, two versions are kept in memory and the full version is altered, adding to and creating new lines, as the flattened one is (with a kind-of pointer following the progress of the pruned-tree analysis)? |
This "other approach" was more more of a random thought than an actual suggestion. It might not even work, and such a sweeping change doesn’t sound like a good idea for a project that’s effectively inactive. |
Grouped in #301. |
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.
Fixed by closing #301. |
WeasyPrint generates spurious line breaks on tag borders at margin boundaries.
The following snippet illustrates the issue; there should be no breaks between the
<em>
tags and theXX
text:The text was updated successfully, but these errors were encountered: