SVG Background Rendering Issue Introduced in v1.11.13
Expected Behavior
SVG images should render with correct backgrounds when converted to images using "html-to-image," maintaining consistency with the original HTML.
Current Behavior
After upgrading "html-to-image" from version 1.11.11 to 1.11.13, SVG image backgrounds are rendered incorrectly, leading to incorrect display of SVG backgrounds in the generated images.
Possible Solution
It's possible that changes in SVG background rendering code in version 1.11.13 are causing the background styles to be processed incorrectly. Review the code changes related to SVG rendering in version 1.11.13, especially the background style handling.
Steps To Reproduce
- open URL: https://vueflow.dev/examples/screenshot.html
- Use "html-to-image" version 1.11.11 to convert the HTML page to an image, verifying correct SVG background rendering.
- Upgrade "html-to-image" to version 1.11.13.
- Use "html-to-image" version 1.11.13 to convert the same HTML page to an image again, observing if SVG background rendering errors occur.
- Compare the two conversion results to confirm that version 1.11.13 introduces the background error.
Your Environment
- html-to-image: 1.11.13 (problematic version), 1.11.11 (working version)
1.11.11 image
1.11.13 image
👋 @forestlet
Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. To help make it easier for us to investigate your issue, please follow the contributing guidelines.
We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.
Thanks for issue, I have the exact same problem. Installed v1.11.11 and it works fine for me too.
For me, v1.11.13 works while in vite development server. But after building and running on the output files, v1.11.13 doesn't work but v1.11.11 works.
I believe the issue was introduced in v.1.11.12 with this: https://github.com/bubkoo/html-to-image/pull/462
I've a similar problem with my node edges:
Before v.1.11.12:
After v.1.11.12: