exupero / saveSvgAsPng

Save SVGs as PNGs from the browser.
MIT License
1.09k stars 362 forks source link

Error by interpreting HTML tags in attribute values of SVG Elements #161

Closed tgotwig closed 6 years ago

tgotwig commented 6 years ago

Hey there 🤗 I get an error for using HTML tags in attribute values, for example:

<line title="<div>TEST</div>"></line>
exupero commented 6 years ago

It appears that attribute values can't contain unescaped < or >. Nor can they apparently contain &lt; or &gt;. The closest I could get was to use &amp;lt; and &amp;gt;.

But you may not actually need this ability. SVG element titles should be included as child tags, as in

<line><title>TEST</title></line>