Skip to content

SVG Background Rendering Issue Introduced in v1.11.13 #506

Open
@forestlet

Description

@forestlet

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

  1. open URL: https://vueflow.dev/examples/screenshot.html
  2. Use "html-to-image" version 1.11.11 to convert the HTML page to an image, verifying correct SVG background rendering.
  3. Upgrade "html-to-image" to version 1.11.13.
  4. 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.
  5. 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
Image

1.11.13 image
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions