MOBI Input: Fix regression causing crash when converting certain MOBI/PRC files

This commit is contained in:
Kovid Goyal 2009-05-02 19:26:40 -07:00
parent 5ac7ff5bf2
commit 66b0b6c58f

View File

@ -294,8 +294,7 @@ class MobiReader(object):
root = html.fromstring(self.processed_html) root = html.fromstring(self.processed_html)
if root.xpath('descendant::p/descendant::p'): if root.xpath('descendant::p/descendant::p'):
from lxml.html import soupparser from lxml.html import soupparser
self.log.warning('Markup contains unclosed <p> tags, parsing using', print 'Markup contains unclosed <p> tags, parsing using BeatifulSoup'
'BeatifulSoup')
root = soupparser.fromstring(self.processed_html) root = soupparser.fromstring(self.processed_html)
self.upshift_markup(root) self.upshift_markup(root)
guides = root.xpath('//guide') guides = root.xpath('//guide')