-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
text annotations: < in href params breaks href tag #2239
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
Thanks for the report @endymonium - you're correct, I don't see any workaround without altering the code. This is a tricky section of code, due to the risk of XSS, but seems to me there are two things we can do, either one of which would give you a workaround:
Option 1 seems fairly straightforward, and would just need to be paired with a test or two in svg_text_utils_test.js of the kind of links this allows us to support. Feel like giving it a try? |
- Bug: an already escaped URI of an HTML link was encoded a second time by Plotly which led to a wrong URI.
- Bug: an already escaped URI of an HTML link was encoded a second time by Plotly which led to a wrong URI.
Handle HTML links with encoded URIs correctly in svg text labels #2239
Hi,
I would like to show a link in chart, unfortunately that links query contains a '<', which leads to plotly not recognizing it as a link: https://jsfiddle.net/2krwamLv/1/
If I encode the '<' manually prior, plotly encodes it again. I looked at the code https://github.com/plotly/plotly.js/blob/master/src/lib/svg_text_utils.js#L214-L221 but I found no easy way around this.
Any ideas?
Thanks,
Jan
The text was updated successfully, but these errors were encountered: