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

Add support for the :not() psuedo-selector #3130

Open
VladimirAus opened this issue Feb 6, 2023 · 6 comments · May be fixed by #3256
Open

Add support for the :not() psuedo-selector #3130

VladimirAus opened this issue Feb 6, 2023 · 6 comments · May be fixed by #3256

Comments

@VladimirAus
Copy link

VladimirAus commented Feb 6, 2023

Selector is used in Bootstrap 4 and causes the error upon PDF generation

Error generating document: Failed to generate PDF: 
The CSS selector '.list-inline-item:not(:last-child)' is not valid

I assume it would be the same for the :not(:first-child)

@bsweeney
Copy link
Member

bsweeney commented Feb 6, 2023

I'm unable to reproduce, which version of Dompdf are you using?

@VladimirAus
Copy link
Author

VladimirAus commented Feb 6, 2023

2.0.2. Reverting back to 2.0.1 fixes the issue.

@bsweeney
Copy link
Member

bsweeney commented Feb 6, 2023

Ah nvm I am able to reproduce the message. The issue is not that the PDF will not render it's that your error reporting is set too high. Specifically, those selector warning shouldn't display unless you have set the global variable $_dompdf_show_warnings to true;. Should be the case in 2.0.1 as well.

@VladimirAus
Copy link
Author

VladimirAus commented Feb 9, 2023

@bsweeney I'm using dompdf with Drupal. If variable is set, it is the same for both version but only fails on 2.0.2

@msupko
Copy link

msupko commented Mar 15, 2023

An FYI for other Drupal users dealing with this issue...if you're using entity_print module, that module has its own error handling and the $_dompdf_show_warnings setting does not apply there. There is a patch available in this issue which resolved the problem for us: https://www.drupal.org/project/entity_print/issues/3323264

@bsweeney
Copy link
Member

bsweeney commented Mar 15, 2023

As for the selector, I believe the issue is that Dompdf does not yet support the :not psuedo-class.

@bsweeney bsweeney changed the title The following selector is not recognised '.list-inline-item:not(:last-child) Add support for the :not() psuedo-selector Mar 15, 2023
@bsweeney bsweeney linked a pull request Feb 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants