-
-
Notifications
You must be signed in to change notification settings - Fork 219
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
fix: [#1151] Skips svg elements when innerText is used #1753
Conversation
…there's more content coming after
// TODO: svg element should return an uppercase SVG tag in html document context | ||
// ref. https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName#value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// TODO: svg element should return an uppercase SVG tag in html document context | |
// ref. https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName#value |
SVG elements in the SVG namespace should actually be in lower case (as it is in an XML namespace).
This can easily be tested in the browser:
var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
document.body.appendChild(svg);
// Outputs "svg"
console.log(svg.tagName);
Thank you for your contribution @karpiuMG ⭐ I found a small thing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a performance fix and removed the comment 🙂
for skipping svg element a change is needed for recognizing tag names as HTML Parser parse svg elements in a way that svg tagName is lowercase - which shouldn't be the case for HTML document context
ref. https://developer.mozilla.org/en-US/docs/Web/API/Element/tagName#value
I leave it to you @capricorn86 - maybe you could add the change in your DOM Parsing PR #1666
close #1151