diff --git a/pywb/regex_rewriters.py b/pywb/regex_rewriters.py index 1c949b60..e8a505e6 100644 --- a/pywb/regex_rewriters.py +++ b/pywb/regex_rewriters.py @@ -191,9 +191,12 @@ class CSSRewriter(RegexRewriter): >>> test_css("@import (\"url.css\")") '@import ("/web/20131010im_/http://example.com/url.css")' + >>> test_css("@import url(/url.css)\n@import url(/anotherurl.css)\n @import url(/and_a_third.css)") + '@import url(/web/20131010im_/http://example.com/url.css)\n@import url(/web/20131010im_/http://example.com/anotherurl.css)\n @import url(/web/20131010im_/http://example.com/and_a_third.css)' + """ - CSS_URL_REGEX = "url\\s*\\(\\s*[\\\\\"']*([^'\"]+)[\\\\\"']*\\s*\\)" + CSS_URL_REGEX = "url\\s*\\(\\s*[\\\\\"']*([^)'\"]+)[\\\\\"']*\\s*\\)" CSS_IMPORT_NO_URL_REGEX = "@import\\s+(?!url)\\(?\\s*['\"]?(?!url[\\s\\(])([\w.:/\\\\-]+)" def __init__(self, rewriter): diff --git a/pywb/replay.py b/pywb/replay.py index 9c88bedc..1b8816e9 100644 --- a/pywb/replay.py +++ b/pywb/replay.py @@ -196,10 +196,10 @@ class RewritingReplayHandler(ReplayHandler): else: (encoding, firstBuff) = self._detectCharset(stream) - # if ascii, set to noop encode operation + # if chardet thinks its ascii, use utf-8 if encoding == 'ascii': - encoding = None - #encoding = 'utf-8' + #encoding = None + encoding = 'utf-8' # Buffering response for html, streaming for others? if rewrittenHeaders.textType == 'html': diff --git a/static/wb.css b/static/wb.css index 2e3a2100..7b91f6ec 100644 --- a/static/wb.css +++ b/static/wb.css @@ -4,7 +4,7 @@ display: block !important; top: 0px !important; left: 0px !important; - position: relative !important; + position: absolute !important; padding: 4px !important; width: 100% !important; font-size: 24px !important;