Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(198)

Unified Diff: grit/format/html_inline.py

Issue 12036024: Fix the regex flatting html to prevent misdetection (Closed) Base URL: https://grit-i18n.googlecode.com/svn/trunk
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | grit/format/html_inline_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: grit/format/html_inline.py
diff --git a/grit/format/html_inline.py b/grit/format/html_inline.py
index 1b59d6a5bfb97a0da7f406b28fd2c8cd912ed042..fc9a061dd308da1d178bc466673dff3bc97434f1 100755
--- a/grit/format/html_inline.py
+++ b/grit/format/html_inline.py
@@ -293,14 +293,14 @@ def DoInline(
flat_text = rewrite_function(input_filepath, flat_text, distribution)
flat_text = re.sub(
- '<(?!script)[^>]+?src=(?P<quote>")(?P<filename>[^"\']*)\\1',
+ '<(?!script)(?:[^>]+?\s)src=(?P<quote>")(?P<filename>[^"\']*)\\1',
SrcReplace, flat_text)
# TODO(arv): Only do this inside <style> tags.
flat_text = InlineCSSImages(flat_text)
flat_text = re.sub(
- '<link rel="icon".+?href=(?P<quote>")(?P<filename>[^"\']*)\\1',
+ '<link rel="icon"\s(?:[^>]+?\s)?href=(?P<quote>")(?P<filename>[^"\']*)\\1',
SrcReplace, flat_text)
if names_only:
« no previous file with comments | « no previous file | grit/format/html_inline_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698