News download: Automatically remove <base> tags in the postptocess phase as they cause links in generated EPUB files to not work

This commit is contained in:
Kovid Goyal 2010-02-06 12:18:28 -07:00
parent bf8324b622
commit 97ba8f07a4
2 changed files with 3 additions and 2 deletions

View File

@ -910,7 +910,6 @@ class OnDeviceSearch(SearchQueryParser):
except ValueError: # Unicode errors
import traceback
traceback.print_exc()
pass
return matches

View File

@ -615,10 +615,12 @@ class BasicNewsRecipe(Recipe):
del o['onload']
for script in list(soup.findAll('noscript')):
script.extract()
script.extract()
for attr in self.remove_attributes:
for x in soup.findAll(attrs={attr:True}):
del x[attr]
for base in list(soup.findAll('base')):
base.extract()
return self.postprocess_html(soup, first_fetch)