-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix no-comment-textnodes incorrectly catching urls (fixes #664) #665
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 no-comment-textnodes incorrectly catching urls (fixes #664) #665
Conversation
e5c6fea
to
9b37d2d
Compare
LGTM. Test failures appear to be related to eslint 3 dropping pre-node-4 support. |
@petersendidit if you rebase on latest master, your tests should pass. |
9b37d2d
to
3354ca3
Compare
3354ca3
to
554eceb
Compare
@@ -19,7 +19,7 @@ module.exports = function(context) { | |||
|
|||
return { | |||
Literal: function(node) { | |||
if (/\s*\/(\/|\*)/.test(node.value)) { | |||
if (/^\s*\/(\/|\*)/m.test(node.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.
since this is just testing the start of a quasi-comment, does it need the "m"?
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.
Without the m
modifier things like this would fail:
<div>
asdjfl
/* invalid */
foo
</div>
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.
ah right, i'm assuming the text node will be split up by lines, and that's not likely to be the case.
Could we add your example as a test, to prevent a regression?
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.
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.
ah, understood, thanks for clarifying :-)
@yannickcr ping :-) |
Merged, thanks! |
Fixes #664.