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

Escape interpolation into entities #35

Open
mbostock opened this issue Jul 29, 2021 · 0 comments
Open

Escape interpolation into entities #35

mbostock opened this issue Jul 29, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@mbostock
Copy link
Member

This:

My favorite currencies are &p${"ounds"};.

should produce this:

My favorite currencies are &pounds;.

However, it instead produces:

My favorite currencies are £s;.

I think in order to do this, we’d need to know whether we’re interpolating into a possibly valid HTML entity, and if so, the ampersand needs to be escaped so that it is equivalent to:

My favorite currencies are &p${"ound"}s;.

We should also test this, which works correctly today:

My favorite currencies are ${"&pounds;"}.
@mbostock mbostock added the bug Something isn't working label Jul 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant