-
-
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
Whitespaces are correctly handled in bookmark labels #607
Comments
@gsnedders -- where does whitespace in bookmark labels distract you? My PDF reader's bookmark-tree is normalized by the readers, never ever realized that there was superfluous whitespace at all. Could create a PR which removes the whitespace, like that: bookmark_label = ' '.join(bookmark_label.split()) |
@Tontyna In Okular they aren't normalised. As for white-space, I was thinking of something like:
where it would seem semantically wrong to collapse the whitespace (and, of course, That said, that's mostly a hypothetical case; collapsing whitespace always would seem better than current given having a descendant of a heading with |
Not shure how to deal with this. The current implementation with all the space from the source included, conforms (almost) to the definition of But I think none of the above is correct, the bookmark-label should contain the
But. WeasyPrint's implementation of |
The spec actually says that white spaces have to be handled by CSS properties in The solution is simply to normalize white spaces before calculating bookmark labels (and named strings). |
This "hack" was introduced to ignore the text-transform property for bookmarks. Now that the whitespace management logic is done after the box creation (just before building the bookmark label), we can do the same for the text transformation (just after building the bookmark label). Related to #607 and #137.
Something like:
Seems to get turned into a bookmark with a label of:
This is… unexpected, as it doesn't match the rendering at all. (i.e., I'd expect
Foo, Bar
with no more whitespace.)I guess technically we probably want to take the
white-space
property into account here?The text was updated successfully, but these errors were encountered: