mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
bf8324b622
commit
97ba8f07a4
@ -910,7 +910,6 @@ class OnDeviceSearch(SearchQueryParser):
|
||||
except ValueError: # Unicode errors
|
||||
import traceback
|
||||
traceback.print_exc()
|
||||
pass
|
||||
return matches
|
||||
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user