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

Figure borders are being doubled in paged.js when floated figure is pushed to next page #732

Open
1 task done
geealbers opened this issue May 17, 2023 · 4 comments
Open
1 task done
Assignees
Labels
bug Actual behavior does not match expected behavior output:pdf An issue with the pdf output status:backlog Issue is a lower priority but needs to eventually be addressed workaround Issue has a workaround

Comments

@geealbers
Copy link
Member

Before proceeding, check to make sure there isn’t an existing issue for this bug.

  • I have searched the existing issues and determined this is a new bug.

Steps to reproduce

  1. Start a new Quire project
  2. Run quire build and then quire pdf to generate the PDF
  3. Open PDF to page 13 for sample of issue

Actual behavior

Stray borders appear at the end of the text, which are an echo of the borders that appear with the figure image on the following page. See screenshots below.

Also worth noting that the image has a float, and in my testing it looked like that might be connected to the issue. I was unable to reproduce this behavior on a non-floating image.

And I did try break-inside: avoid but it didn't solve the issue.

pagedjs_Page_13

pagedjs_Page_14

Expected behavior

The borders and figure images should always stay together, and not duplicate across the page

Version numbers

Quire CLI 1.0.0-rc.7
Quire 11ty 1.0.0-rc.9
Node 18.16.0

What browsers are you seeing the problem on?

No response

Relevant Terminal/Shell output

No response

Supporting Information

No response

@geealbers geealbers added the status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues. label May 17, 2023
@fchasen
Copy link
Collaborator

fchasen commented May 26, 2023

There is something strange happening with the fragmentation here, it shouldn't be finding that the image has gone to the next page without also seeing the figure div has - will continue to debug it and hopefully release a more general upstream fix.

For now a quick fix is to just add:

.q-figure:empty {
	display:none;
}

@geealbers
Copy link
Member Author

Thanks @fchasen, I'll add that workaround in for now.

FYI, I also noticed that the figure as it appears on the following page is missing it's top padding, which is being stripped out with:

.pagedjs_pages > .pagedjs_page > .pagedjs_sheet > .pagedjs_pagebox > .pagedjs_area > div [data-split-from] {
    text-indent: unset;
    margin-top: unset;
    padding-top: unset;
    initial-letter: unset;
}

So I added an additional rule to the workaround to put the padding back in:

.pagedjs_pages > .pagedjs_page > .pagedjs_sheet > .pagedjs_pagebox > .pagedjs_area > div .q-figure[data-split-from] {
  padding-top: 1rem;
}

@Erin-Cecele Erin-Cecele added workaround Issue has a workaround output:pdf An issue with the pdf output bug Actual behavior does not match expected behavior and removed status:triage needed Issue needs to be triaged by the Quire team. This label is automatically applied to new issues. labels May 30, 2023
@Erin-Cecele Erin-Cecele added the status:in progress Issue is under development label Jun 26, 2023
@geealbers geealbers assigned geealbers and unassigned fchasen Jul 12, 2023
@Erin-Cecele
Copy link
Collaborator

We are currently working on a fix for your bug! Stay tuned for updates, and thank you for your important contribution.

@Erin-Cecele Erin-Cecele added status:backlog Issue is a lower priority but needs to eventually be addressed and removed status:in progress Issue is under development labels Oct 11, 2023
@Erin-Cecele
Copy link
Collaborator

@geealbers As far as I can tell, this issue appears to be resolved in cli-rc.14 / 11ty-rc.17

Screen Shot 2024-08-08 at 3 45 58 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual behavior does not match expected behavior output:pdf An issue with the pdf output status:backlog Issue is a lower priority but needs to eventually be addressed workaround Issue has a workaround
Projects
None yet
Development

No branches or pull requests

3 participants