mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-23 01:15:15 +02:00
...
This commit is contained in:
parent
2ded6daf02
commit
e4ea6f9e15
1 changed files with 4 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import re
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
from calibre.ebooks.BeautifulSoup import Tag
|
||||
from calibre.ebooks.BeautifulSoup import Tag, NavigableString
|
||||
from datetime import date, timedelta
|
||||
|
||||
|
||||
|
|
@ -235,6 +235,9 @@ def preprocess_raw_html(self, raw, *a):
|
|||
def preprocess_html(self, soup):
|
||||
body = soup.find('body')
|
||||
title = soup.find('title')
|
||||
t = type('')(title.contents[0]).partition('-')[0].strip()
|
||||
del title.contents[0]
|
||||
title.contents.append(NavigableString(t))
|
||||
title.name = 'h1'
|
||||
body.insert(0, title)
|
||||
images = soup.findAll("img")
|
||||
|
|
|
|||
Loading…
Reference in a new issue