Permalink
Browse files

you don't need to fix closing tags with method='html'

  • Loading branch information...
1 parent 75c1e90 commit 9b7039a6a82388327ba9108e0df45903fe275b19 @peterbe committed Mar 6, 2013
Showing with 1 addition and 8 deletions.
  1. +1 −8 proxy/app.py
View
9 proxy/app.py
@@ -196,14 +196,7 @@ def css_url_replacer(match, href=None):
collect_stats
)
- html = etree.tostring(page)
- # the etree.tostring() method will turn `<script src="foo"></script>'
- # to `<script src="foo"/>`. Fix that.
- for each, tag in CLOSING_REGEX.findall(html):
- html = html.replace(
- each,
- each.replace('/>', '></%s>' % tag)
- )
+ html = etree.tostring(page, method='html')
if collect_stats:
html = re.sub(
'<body[^>]*>',

0 comments on commit 9b7039a

Please sign in to comment.