Skip to content
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

HTML &#; entities not supported #233

Open
mcclure opened this issue Nov 24, 2022 · 0 comments
Open

HTML &#; entities not supported #233

mcclure opened this issue Nov 24, 2022 · 0 comments

Comments

@mcclure
Copy link

mcclure commented Nov 24, 2022

nanosvg.h does not appear to currently support HTML entity codes, such as &#59; for ". This is troublesome because some special characters like "<> can only appear in some positions as entities. A tool I am using ("Figma") is encoding a > characters in a shape id as &#62;, which is causing problems for my program when it tires to read that id using nanosvg (and it sees a raw &#62; instead of the < it expects).

I wrote a small &# code decoder and would like to upstream it as a PR. However, I'm not sure exactly where to put it. I think the place to put the entity decode is

	} else if (strcmp(name, "id") == 0) {
		strncpy(attr->id, value, 63);

in nsvg__parseAttr, either right after the strncpy or possibly replacing it. However, are there other places it is appropriate to do HTML entity decoding in such a patch? For example are <text> tags currently supported?

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

No branches or pull requests

1 participant