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

Regression: In 63.0, SVG files with <symbol> tags fail to render #2316

Closed
nnsee opened this issue Dec 2, 2024 · 1 comment
Closed

Regression: In 63.0, SVG files with <symbol> tags fail to render #2316

nnsee opened this issue Dec 2, 2024 · 1 comment
Labels
bug Existing features not working as expected

Comments

@nnsee
Copy link

nnsee commented Dec 2, 2024

Hello!

Example SVG:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 100" width="200" height="100">
  <symbol id="star" viewBox="0 0 24 24">
    <polygon points="12,2 15,9 22,9 16,14 18,21 12,17 6,21 8,14 2,9 9,9" fill="gold" />
  </symbol>

  <use href="#star" x="80" y="10" width="50" height="50" />
</svg>

In v63.0, attempting to render this SVG fails.

$ weasyprint-dev test.svg out.pdf
ERROR: Failed to load inline SVG: 'SVG' object has no attribute 'symbols'

A bisect narrows this down to commit d566245. Reverting this commit allows the SVG to be rendered again.

@liZe
Copy link
Member

liZe commented Dec 3, 2024

Thanks a lot for the report and the short sample, that was really easy to reproduce. It should be fixed now!

@liZe liZe added crash Problems preventing documents from being rendered bug Existing features not working as expected and removed crash Problems preventing documents from being rendered labels Dec 3, 2024
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