Closed listopadiya closed 3 years ago
Thanks for the issue report. Could you prepare a PR with the workaround you suggest?
Sure, you can assign it to me! I was thinking that this issue in a way blocks comprehensive playground testing for #152 , so it would be nice to have it fixed first, and I can try it.
Describe the bug
DOMPurify
is used to sanitize all input text in playground, and by default it filters<use>
elements out, so in both SVG and PDF outputs they are not visible. Also it leads to<use>
elements not preserved in playground url.One possible solution will be to use workaround provided by
DOMPurify
developers here, it will allow to safely use internal references. It can be placed here: https://github.com/yWorks/svg2pdf.js/blob/929a2ba18bd55fa04bc012da9b5f6c8646a79c7d/playground/index.js#L28To Reproduce Check this code in playground:
Screenshot Note: I changed height of input and output boxes in chrome devtools, so that it takes less space in screenshot.
Expected behavior Example from above should result in two circles output (blue and orange), like in this codepen.
Desktop (please complete the following information):