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

Unified Diff: grit/format/html_inline.py

Issue 11953014: Fix the regex flatting html to prevent misdetection (Closed) Base URL: http://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
===================================================================
--- grit/format/html_inline.py (revision 102)
+++ grit/format/html_inline.py (working copy)
@@ -293,14 +293,14 @@
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