-
-
Notifications
You must be signed in to change notification settings - Fork 681
Add namespace check of svg & mathML instead of tag names #120
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
Add namespace check of svg & mathML instead of tag names #120
Conversation
lib/utils/index.js
Outdated
*/ | ||
isHtmlElementName (name) { | ||
assert(typeof name === 'string') | ||
isHtmlElementNode (node) { |
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.
Thank you for good change.
However, it might cause confusing if isHtmlElementNode
is not checking their namespace but isSvgElementNode
and isMathMLElementNode
are checking their namespace. How about renaming to isKnownHtmlElementNode
?
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.
@mysticatea I think we should add namespace check to it to... <a>
can be in both HTML and SVG
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.
@armano2 Oh, good catch! Also <style>
and <script>
exist in SVG.
add namespace check for html
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.
LGTM, thank you!
* master: Add rule `vue/require-valid-default-prop`. (vuejs#119) 3.10.0 Update readme to 3.10.0 Chore: remove package-lock.json (vuejs#128) Fix: parserService must exist always (fixes vuejs#125) (vuejs#127) Add rule `require-render-return`. (vuejs#114) 3.9.0 Update package-lock Update: options for `no-duplicate-attributes` (fixes vuejs#112)(vuejs#113) New: add rule `attribute-hyphenation`. (fixes vuejs#92)(vuejs#95) Add namespace check of svg & mathML instead of tag names (vuejs#120)⚠️ Add support for deprecated state in update-rules⚠️ (vuejs#121) Add rules: `no-dupe-keys` and `no-reserved-keys`. (vuejs#88) Chore: Improve tests for name-property-casing & improve documentation (vuejs#115) New: add `require-prop-types` rule (fixes vuejs#19)(vuejs#85) Update: upgrade vue-eslint-parser (fixes vuejs#36, fixes vuejs#56, fixes vuejs#96) (vuejs#116)
Old:
isHtmlElementName(string)
isSvgElementName(string)
New:
isKnownHtmlElementNode(ASTNode)
isSvgElementNode(ASTNode)
isMathMLElementNode(ASTNode)
and broken / deprecated / unused
getTemplateBodyTokenStore
is removed in this commit