You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With very limited space or fixed layouts the possibilities to handle too long text are not enough (overflow).
For example it would be nice to be able to limit a text to 3 lines.
overflow:hidden is not really a solution to the problem because you need a fixed height. If my text is only 2 lines high, I'll get an empty line. That's not always what I want. Even setting a fixed height is not as easy as it sounds. For example the height of UL-LI is not predictable if you have LI margins different to line height and sometimes a LI has two lines.
text-overflow: ellipsis; is implemented in weasyprint but it is very limited.
I know this issue is a very general one and describes not only one problem. As I don't know the solution(s) yet I would like to discuss the problem here. I'm aware that maybe CSS itself has no solution.
What's needed (I guess):
make text-overflow work with white-space: normal
make text-overflow work with UL/OL
possibility to use max-height with text-overflow
the box shrink to the displayed lines/text and not max-height
setting the max-height to x lines would be nice (that's way out of CSS spec I guess)
For a more visual description here's an image of text-overflow: ellipsis; and what the limitations are
The text was updated successfully, but these errors were encountered:
liZe
changed the title
Better handling of overflow text
Add support of block-overflow
Feb 11, 2020
What you want is break-overflow. It’s currently supported by browsers using the -webkit-line-clamp property (even in Firefox), but in a very limited way.
We should follow the specs and do better with WeasyPrint!
Hi there thanks for your awesome work on WeasyPrint. I would courrently have a big need on the feature requested here. - Can you give a forecast if it will be implemented and or when? - Or if already happened how i can use it? - I dont manage to get it to work...
With very limited space or fixed layouts the possibilities to handle too long text are not enough (overflow).
For example it would be nice to be able to limit a text to 3 lines.
overflow:hidden
is not really a solution to the problem because you need a fixed height. If my text is only 2 lines high, I'll get an empty line. That's not always what I want. Even setting a fixed height is not as easy as it sounds. For example the height of UL-LI is not predictable if you have LI margins different to line height and sometimes a LI has two lines.text-overflow: ellipsis;
is implemented in weasyprint but it is very limited.I know this issue is a very general one and describes not only one problem. As I don't know the solution(s) yet I would like to discuss the problem here. I'm aware that maybe CSS itself has no solution.
What's needed (I guess):
For a more visual description here's an image of
text-overflow: ellipsis;
and what the limitations areThe text was updated successfully, but these errors were encountered: