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

node svg example double-encodes element attributes #8558

Closed
Rob--W opened this issue Jun 21, 2017 · 2 comments · Fixed by #13590
Closed

node svg example double-encodes element attributes #8558

Rob--W opened this issue Jun 21, 2017 · 2 comments · Fixed by #13590

Comments

@Rob--W
Copy link
Member

Rob--W commented Jun 21, 2017

setAttributeNS: function DOMElement_setAttributeNS(NS, name, value) {
value = value || '';
value = xmlEncode(value);
this.attributes[name] = value;

  setAttributeNS: function DOMElement_setAttributeNS(NS, name, value) {
    value = value || '';
    value = xmlEncode(value);
    this.attributes[name] = value;

buf.push(' ' + i + '="' + xmlEncode(this.attributes[i]) + '"');

      buf.push(' ' + i + '="' + xmlEncode(this.attributes[i]) + '"');

One of the two should be removed. Most likely the first one, because getAttributeNS's implementation just returns this.attributes[i], and that should not be encoded.

@Rob--W Rob--W added the other label Jun 21, 2017
@yurydelendik
Copy link
Contributor

Can we replace our stubs with jsdom / jsdom-global?

@Rob--W
Copy link
Member Author

Rob--W commented Jun 21, 2017

I think that it's better to not do that. We use a very limited subset of the DOM, so it is relatively easy to implement and optimize the stubs for our use case; jsdom seems overkill for us. Also, our example currently does not have any external module dependencies, which simplifies testing (though this is a very minor point).

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

Successfully merging a pull request may close this issue.

2 participants