mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Merge branch 'master' of https://github.com/unkn0w7n/calibre
This commit is contained in:
commit
15a62fe56b
@ -131,13 +131,16 @@ class BusinessStandardPrint(BasicNewsRecipe):
|
|||||||
if 'alt_text' in data['featuredImageObj']:
|
if 'alt_text' in data['featuredImageObj']:
|
||||||
caption = '<span>' + data['featuredImageObj']['alt_text'] + '</span></p>'
|
caption = '<span>' + data['featuredImageObj']['alt_text'] + '</span></p>'
|
||||||
|
|
||||||
body = data['htmlContent'].replace('<br />\r\n\t\t ', '<br>')
|
body = data['htmlContent']
|
||||||
|
|
||||||
return '<html><body>' + cat + title + subhead + auth + lede + caption + '<div><br>' + body + '</div></body></html>'
|
return '<html><body>' + cat + title + subhead + auth + lede + caption + '<div><br>' + body + '</div></body></html>'
|
||||||
|
|
||||||
def preprocess_html(self, soup):
|
def preprocess_html(self, soup):
|
||||||
for img in soup.findAll('img'):
|
for img in soup.findAll('img'):
|
||||||
img.attrs = {'src': img.get('src', '')}
|
img.attrs = {'src': img.get('src', '')}
|
||||||
for x in soup.findAll('div'):
|
for x in soup.findAll('div', 'p'):
|
||||||
x.attrs = {'class': x.get('class', '')}
|
x.attrs = {'class': x.get('class', '')}
|
||||||
|
for attr in self.remove_attributes:
|
||||||
|
for x in soup.findAll(attrs={attr: True}):
|
||||||
|
del x[attr]
|
||||||
return soup
|
return soup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user