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

Cannot render SVG when using unescaped characters as classnames #1625

Closed
VeteraNovis opened this issue Apr 20, 2022 · 1 comment
Closed

Cannot render SVG when using unescaped characters as classnames #1625

VeteraNovis opened this issue Apr 20, 2022 · 1 comment
Labels
bug Existing features not working as expected
Milestone

Comments

@VeteraNovis
Copy link
Contributor

VeteraNovis commented Apr 20, 2022

Summary

When attempting to render an SVG, I was encountering the following error:

ERROR: Failed to load image at 'file:///path/to/image.svg': SelectorError: (<LiteralToken `>, 'unpexpected literal token.')

Upon inspection, the inline styling inside the SVG image contained classes named a`.

Resolution

By escaping the grave accent a\` the problem was resolved.

Notes

Also note the spelling mistake in the error message. unpexpected

Version information

System: Linux
Machine: x86_64
Version: #44-Ubuntu SMP Thu Mar 24 15:35:05 UTC 2022
Release: 5.13.0-39-generic

WeasyPrint version: 54.3
Python version: 3.9.7
Pydyf version: 0.1.2
Pango version: 14810

liZe added a commit to Kozea/cssselect2 that referenced this issue Apr 20, 2022
@liZe
Copy link
Member

liZe commented Apr 20, 2022

Hi!

Thank you for this bug report.

Also note the spelling mistake in the error message. unpexpected

It’s been fixed in 8d75919, thanks!

When attempting to render an SVG, I was encountering the following error:

You’re right, this error should be just a warning, and the SVG should be rendered (ignoring this wrong CSS rule).

@liZe liZe added the bug Existing features not working as expected label Apr 20, 2022
@liZe liZe added this to the 55.0 milestone Apr 27, 2022
@liZe liZe closed this as completed in fb3c39e Apr 28, 2022
liZe added a commit that referenced this issue Apr 28, 2022
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