-
Notifications
You must be signed in to change notification settings - Fork 3.7k
SVG export: Incorrect escaping for HTML within legend label #17753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The legend is part of the HTML portion of the chart. When the user exports to SVG, the The body of the |
Thank you @1tgr for reporting that issue. From what I can see, the |
I agree, since The relevant part of the XML spec: https://www.w3.org/TR/xml/#NT-AttValue There they have a regex for valid double-quoted attributes: And single-quoted attributes: But |
SVG exporting not working when title contains "<"When title contains less-than sign "<", then SVG exporting does not work - See fiddle (click on hamburger-icon -> Download SVG vector image -> open it). Our team extracts a chart's SVG and using that svg does multiple exporting operations like copy chart, download png, print chart, mail chart, put it in our reporting system, etc. None of these are working when chart's title contains "<". Reported at Topic#49880. |
Expected behaviour
When
useHTML: true
, a legend label whose HTML has a<
symbol inside an attribute value produces valid SVG when exported.Actual behaviour
The
<
symbol is not escaped on the exported SVG. Instead, it appears as a literal character within an SVG attribute value.Live demo with steps to reproduce
https://jsfiddle.net/y7vtpzb4/2
exporting
module:<script src="https://code.highcharts.com/modules/exporting.js"></script>
Product version
Highcharts 10.1.0, 10.2.1
Affected browser(s)
Google Chrome on Windows version 105.0.5195.127
Safari on Mac OS version 15.6.1 (17613.3.9.1.16)
The text was updated successfully, but these errors were encountered: