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

white-space: nowrap cutting off instead of wrapping #302

Closed
zimmi opened this issue Dec 6, 2018 · 5 comments
Closed

white-space: nowrap cutting off instead of wrapping #302

zimmi opened this issue Dec 6, 2018 · 5 comments

Comments

@zimmi
Copy link
Contributor

zimmi commented Dec 6, 2018

Running the following snippet:

<html>
    <head>
        <style>
            @page {
                size: A4;
                margin: 72pt;
            }
            .heading {
                text-align: center;
                font-size: 20pt;
            }
            .nowrap {
                white-space: nowrap;
                background-color: yellow;
            }
        </style>
    </head>
    <body>
        <div class="heading">heading heading heading heading heading heading <span class="nowrap">should wrap together</span> heading heading heading</div>
    </body>
</html>

... produces this output: white_space_nowrap_bug.pdf

I expected all text to be displayed and a line break before should wrap together. Am I doing something wrong? My HTML skills are admittedly pretty rusty.

@zimmi zimmi changed the title white-space: nowrap white-space: nowrap cutting off instead of wrapping Dec 6, 2018
@danfickle
Copy link
Owner

Yes, seems to be a significant bug. The inline boxing functionality needs a rewrite to address this issue, #113 and #39. However it is a 300 line monster so I need a lot more tests around it before attempting. I’m starting to write text tests at the moment so there is hope.

@zimmi
Copy link
Contributor Author

zimmi commented Dec 7, 2018

Thanks for doing this! It's probably best to clean up the foundation first, it's not super critical for my project at the moment anyway.
I think I touched that code slightly in #304 to fix another bug / annoyance.

@danfickle
Copy link
Owner

Thank for reminding me that we need to keep min/max width functions in sync with inline boxing function.

@jaylemur
Copy link

jaylemur commented Jun 14, 2019

Any news concerning this Ticket ?
Is there meanwhile a workaround to avoid this cutting off ?

Thanks in advance.

@vipcxj
Copy link
Contributor

vipcxj commented Oct 20, 2020

I need a workaround, too.

vipcxj added a commit to vipcxj/openhtmltopdf that referenced this issue Oct 23, 2020
vipcxj added a commit to vipcxj/openhtmltopdf that referenced this issue Oct 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants