Skip to content

[Bug] – /   in annotation causes malformed SVG download #3238

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

Closed
Braintelligence opened this issue Nov 13, 2018 · 3 comments
Closed
Labels
bug something broken

Comments

@Braintelligence
Copy link

Braintelligence commented Nov 13, 2018

Hi everyone.
So if you use – in annotations: [{ text: "–}]" you get a malformed SVG. Why does   work, though?

EDIT:   also doesn't work...

Here an example: https://codepen.io/anon/pen/MzJoOG

@Braintelligence Braintelligence changed the title [Bug] – in annotation causes malformed SVG download [Bug] – /   in annotation causes malformed SVG download Nov 13, 2018
@alexcjohnson
Copy link
Collaborator

Ah thanks - definitely a bug that the SVG is malformed, but we don't currently plan to support arbitrary named HTML entities (so I'd say the "correct result" here would be to display "–" literally. The latest status of that is #2932 in which we added support for all numbered HTML entities (simplified example for – = –: https://codepen.io/alexcjohnson/pen/NMdMbE?editors=1010) but in that PR we noted:

Note that this would make it feasible, performance-wise, to include ALL named html entities, but the full list is over 2000 items, and there are other options (unicode literals, or numbered entities if you want your code/JSON to be pure ASCII) so I suggest we keep it at just the existing set.

The "existing set" is a few entities we've supported for a very long time:

var entityToUnicode = {
mu: 'μ',
amp: '&',
lt: '<',
gt: '>',
nbsp: ' ',
times: '×',
plusmn: '±',
deg: '°'
};

@alexcjohnson alexcjohnson added the bug something broken label Nov 13, 2018
@Braintelligence
Copy link
Author

Ah I see!
Well I've helped myself with unicode now 😹. Will switch to numbered HTML entities due to code-readability. Thanks for pointing it out! 👍

@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken
Projects
None yet
Development

No branches or pull requests

3 participants