mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:...
This commit is contained in:
parent
e917f2cf11
commit
894c1570db
@ -86,11 +86,10 @@ class Splitter(LoggingInterface):
|
|||||||
root = tree.getroot()
|
root = tree.getroot()
|
||||||
# Split large <pre> tags
|
# Split large <pre> tags
|
||||||
for pre in list(root.xpath('//pre')):
|
for pre in list(root.xpath('//pre')):
|
||||||
text = u''.join(pre.xpath('./text()'))
|
text = u''.join(pre.xpath('descendant::text()'))
|
||||||
pre.text = text
|
pre.text = text
|
||||||
for child in list(pre.iterchildren()):
|
for child in list(pre.iterchildren()):
|
||||||
pre.remove(child)
|
pre.remove(child)
|
||||||
pre.text += u''.join(child.xpath('./text()'))
|
|
||||||
if len(pre.text) > self.opts.profile.flow_size*0.5:
|
if len(pre.text) > self.opts.profile.flow_size*0.5:
|
||||||
frags = self.split_text(pre.text, root, int(0.2*self.opts.profile.flow_size))
|
frags = self.split_text(pre.text, root, int(0.2*self.opts.profile.flow_size))
|
||||||
new_pres = []
|
new_pres = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user