mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-08-31 21:41:33 +00:00
Don't bother decoding latin1 for pages.
This commit is contained in:
parent
7889fd831e
commit
ec35f2156a
1 changed files with 5 additions and 5 deletions
|
@ -225,11 +225,11 @@ class PageImporter(object):
|
|||
def rewrite_page(self, response):
|
||||
BASE_RE = re.compile(r'<head(.*?\>)', re.I)
|
||||
base_code = u'<base href="%s" />' % (self.feed.feed_link,)
|
||||
try:
|
||||
html = BASE_RE.sub(r'<head\1 '+base_code, response)
|
||||
except:
|
||||
response = response.decode('latin1').encode('utf-8')
|
||||
html = BASE_RE.sub(r'<head\1 '+base_code, response)
|
||||
# try:
|
||||
html = BASE_RE.sub(r'<head\1 '+base_code, response)
|
||||
# except:
|
||||
# response = response.decode('latin1').encode('utf-8')
|
||||
# html = BASE_RE.sub(r'<head\1 '+base_code, response)
|
||||
|
||||
if '<base href' not in html:
|
||||
html = "%s %s" % (base_code, html)
|
||||
|
|
Loading…
Add table
Reference in a new issue