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..bca4f2f5bd2e07fdd7e487df48dbeaec62ca9fc1 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+ # The tag name. |
+ (?:\s+\S+\$?="[^"]*"|\s+\S+)* # Correctly quoted or non-value props. |
+ \s+\S+\$?='[^']*' # Find incorrectly quoted (foo='bar'). |
+ [^>]*>) # To the end of the tag. |
Dan Beam
2016/06/25 00:49:03
why is the match around the whole tag? why not ju
dschuyler
2016/06/28 19:04:18
I'd thought that the context around the error woul
|
+ """, |
+ self.input_api.re.MULTILINE | self.input_api.re.VERBOSE) |
+ 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 |