bubkoo / html-to-image

✂️ Generates an image from a DOM node using HTML5 canvas and SVG.
MIT License
5.4k stars 505 forks source link

SVG symbols with `<use href="..." />` are ommited #392

Open snelsi opened 1 year ago

snelsi commented 1 year ago

When processing svg elements with <use href="..." />, they will be ommited in the resulted image.

This library only handles xlink:href param, which is considered deprecated:

image

Expected Behavior

Parse both href and xlink:href params.

Current Behavior

<use href="..." /> is ignored

Possible Solution

Update this selector to handle both cases: https://github.com/bubkoo/html-to-image/blob/b751cbf212ccc7909077bc105b0630f9c845389a/src/clone-node.ts#L196

vivcat[bot] commented 1 year ago

👋 @snelsi

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.