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

@page :nth(an+b) rule bug #1668

Closed
kian-supportinglines opened this issue Jun 29, 2022 · 1 comment
Closed

@page :nth(an+b) rule bug #1668

kian-supportinglines opened this issue Jun 29, 2022 · 1 comment
Labels
bug Existing features not working as expected
Milestone

Comments

@kian-supportinglines
Copy link

Version: 52.5 (No fix found in changelogs of newer versions)

I've noticed that when using the @page :nth(an+b) rule, the b value is not being used.

E.g. @page :nth(2n+5) will apply to every other page, instead of every other page after the 5th page.

A simple way to reproduce this bug:

HTML:

<body>
    <div>
        <p>Some content here</p>
    <div>
    <div style="page-break-before:always">  <!-- To enforce a new page being created -->
        <p>Some other content here</p>
    <div>
</body>

CSS:

@page :nth(n+1) {
    bottom-right: {
        content: counter(page);
    }
}

This should put page numbers for the second page only, but you should see that it creates page numbers for both pages. I tried debugging and only found that the stylesheets were getting correctly parsed, but I don't know why when rendering the CSS it doesn't take into account the b.

@liZe liZe added the bug Existing features not working as expected label Jul 1, 2022
@liZe liZe added this to the 56.0 milestone Jul 1, 2022
@liZe liZe closed this as completed in 1a4d2a7 Jul 1, 2022
@liZe
Copy link
Member

liZe commented Jul 1, 2022

Hi!

Thanks a lot for your bug report, it’s fixed in master and will be fixed in version 56.

netbsd-srcmastr referenced this issue in NetBSD/pkgsrc Jul 9, 2022
Version 56.0
------------

Released on 2022-07-07.

This version also includes the changes from unstable b1 version listed
below.

New features:

* `70f9b62 <https://github.com/Kozea/WeasyPrint/commit/70f9b62>`_:
  Support format 5 for bitmap glyphs

Bug fixes:

* `1666 <https://github.com/Kozea/WeasyPrint/issues/1666>`_
  Fix reproducible PDF generation with embedded images
* `1668 <https://github.com/Kozea/WeasyPrint/issues/1668>`_:
  Fix @page:nth() selector
* `3bd9a8e <https://github.com/Kozea/WeasyPrint/commit/3bd9a8e>`_:
  Don’t limit the opacity groups to the original box size
* `cb9540b <https://github.com/Kozea/WeasyPrint/commit/cb9540b>`_,
  `76d174f <https://github.com/Kozea/WeasyPrint/commit/76d174f>`_,
  `9ce6547 <https://github.com/Kozea/WeasyPrint/commit/9ce6547>`_:
  Minor bugfixes for split table rows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants