This commit is contained in:
Kovid Goyal 2008-10-17 11:28:52 -07:00
parent e917f2cf11
commit 894c1570db

View File

@ -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 = []