mirror of
https://github.com/webrecorder/pywb.git
synced 2025-03-15 00:03:28 +01:00
html rewriter: cleanup rewrite_srcset, add more tests for empty rewrite
This commit is contained in:
parent
6a5842d983
commit
3b68ef6540
@ -216,8 +216,7 @@ class HTMLRewriterMixin(object):
|
||||
return ''
|
||||
|
||||
values = value.split(',')
|
||||
values = map(lambda x: self._rewrite_url(x.strip()), values)
|
||||
values = [v for v in values if v is not None]
|
||||
values = [self._rewrite_url(v.strip()) for v in values]
|
||||
return ', '.join(values)
|
||||
|
||||
def _rewrite_css(self, css_content):
|
||||
|
@ -49,6 +49,12 @@ r"""
|
||||
>>> parse('<base href="static/"/><img src="image.gif"/>', urlrewriter=no_base_canon_rewriter)
|
||||
<base href="static/"/><img src="/web/20131226101010im_/http://example.com/some/path/static/image.gif"/>
|
||||
|
||||
# Empty url
|
||||
>>> parse('<base href="">')
|
||||
<base href="">
|
||||
|
||||
>>> parse('<base href>')
|
||||
<base href>
|
||||
|
||||
|
||||
# HTML Entities
|
||||
|
Loading…
x
Reference in New Issue
Block a user