Ignore Polymer bound src="[[attr]]" from grit processing. (issue 1374383003 by dbeam@chromium.org)

0 views
Skip to first unread message

db...@chromium.org

unread,
Sep 30, 2015, 6:30:37 PM9/30/15
to esp...@chromium.org, grit-de...@googlegroups.com
Reviewers: esprehn,

Description:
Ignore Polymer bound src="[[attr]]" from grit processing.

R=esp...@chromium.org
BUG=526577

Please review this at https://codereview.chromium.org/1374383003/

Base URL: https://chromium.googlesource.com/external/grit-i18n.git@master

Affected files (+2, -1 lines):
M grit/format/html_inline.py
M grit/format/html_inline_unittest.py


Index: grit/format/html_inline.py
diff --git a/grit/format/html_inline.py b/grit/format/html_inline.py
index
bb8416d5c04bdaea427de86365cdfdd394bb9aec..b4413a0ec3238ebcde382520d174fc3e74c1309f
100755
--- a/grit/format/html_inline.py
+++ b/grit/format/html_inline.py
@@ -46,7 +46,7 @@ _INCLUDE_RE = lazy_re.compile(
'<include[^>]+?src="(?P<filename>[^"\']*)".*?>(\s*</include>)?',
re.DOTALL)
_SRC_RE = lazy_re.compile(
- r'<(?!script)(?:[^>]+?\s)src=(?P<quote>")(?P<filename>[^"\']*)\1',
+ r'<(?!script)(?:[^>]+?\s)src=(?P<quote>")(?P<filename>[^"\'\[]*)\1',
re.MULTILINE)
_ICON_RE = lazy_re.compile(
r'<link rel="icon"\s(?:[^>]+?\s)?'
Index: grit/format/html_inline_unittest.py
diff --git a/grit/format/html_inline_unittest.py
b/grit/format/html_inline_unittest.py
index
f392cf5f481d2ab8e387686890948aaf788da2e3..773599c69c5a32267bcda51521a57dcbef270446
100755
--- a/grit/format/html_inline_unittest.py
+++ b/grit/format/html_inline_unittest.py
@@ -37,6 +37,7 @@ class HtmlInlineUnittest(unittest.TestCase):
<include src="test.html">
<include

src="really-long-long-long-long-long-test-file-omg-so-long.html">
+ <iron-icon src="[[icon]]"></iron-icon><!-- Should be ignored. -->
</body>
</html>
''',


esp...@chromium.org

unread,
Sep 30, 2015, 10:21:03 PM9/30/15
to db...@chromium.org, grit-de...@googlegroups.com
Do you also want to exclude { bindings? I'll admit I don't totally
understand
how grit works but this lgtm

https://codereview.chromium.org/1374383003/

db...@chromium.org

unread,
Oct 1, 2015, 1:53:57 AM10/1/15
to esp...@chromium.org, grit-de...@googlegroups.com
On 2015/10/01 02:21:02, esprehn wrote:
> Do you also want to exclude { bindings? I'll admit I don't totally
> understand
> how grit works but this lgtm

Done.

https://codereview.chromium.org/1374383003/

fla...@chromium.org

unread,
Oct 1, 2015, 1:55:06 PM10/1/15
to db...@chromium.org, esp...@chromium.org, grit-de...@googlegroups.com
lgtm, committed revision 199.


https://codereview.chromium.org/1374383003/

db...@chromium.org

unread,
Oct 1, 2015, 1:55:51 PM10/1/15
to esp...@chromium.org, fla...@chromium.org, grit-de...@googlegroups.com
On 2015/10/01 17:55:05, flackr wrote:
> lgtm, committed revision 199.

w00t! thanks Rob!

https://codereview.chromium.org/1374383003/
Reply all
Reply to author
Forward
0 new messages