Index: chrome/browser/web_dev_style/html_checker.py |
diff --git a/chrome/browser/web_dev_style/html_checker.py b/chrome/browser/web_dev_style/html_checker.py |
index 422b7852185410a6f833185faee07bc96a269034..75ffb4be03c1ca0be8dd0bce5deae5010ae463f4 100644 |
--- a/chrome/browser/web_dev_style/html_checker.py |
+++ b/chrome/browser/web_dev_style/html_checker.py |
@@ -44,6 +44,17 @@ class HtmlChecker(object): |
return regex_check.RegexCheck(self.input_api.re, line_number, line, regex, |
'Use the button element instead of <input type="button">') |
+ def DoNotUseSingleQuotesCheck(self, line_number, line): |
+ regex = self.input_api.re.compile(""" |
+ (<\s*\S+ # The tag name. |
Dan Beam
2016/06/23 21:00:47
HTML does not allow "< tag"
you should change <\s
dschuyler
2016/06/23 22:03:07
Done.
|
+ (?:\s+\S+\s*="[^"]*"|\s+\S+)* # Correctly quoted or non-value props. |
Dan Beam
2016/06/23 21:00:47
what about attr$='value'?
Dan Beam
2016/06/23 21:00:47
i don't think attr ="blah" is valid either, can yo
dschuyler
2016/06/23 22:03:07
Done.
dschuyler
2016/06/23 22:03:07
Done.
|
+ \s+\S+='[^']*' # Find incorrectly quoted (foo='bar'). |
+ [^>]*>) # To the end of the tag. |
+ """, |
+ self.input_api.re.VERBOSE) |
Dan Beam
2016/06/23 21:00:47
this should probably be multi-line
dschuyler
2016/06/23 22:03:07
Done.
|
+ return regex_check.RegexCheck(self.input_api.re, line_number, line, regex, |
+ 'Use double quotes rather than single quotes in HTML properties') |
+ |
def I18nContentJavaScriptCaseCheck(self, line_number, line): |
regex = self.input_api.re.compile(""" |
(?:^|\s) # start of line or whitespace |