Fix bug introduced in previous commit.

This commit is contained in:
Kovid Goyal 2007-06-25 18:08:58 +00:00
parent 111bb7ad54
commit 2ed012f023

View File

@ -1013,16 +1013,16 @@ class HTMLConverter(object):
self.current_para = Paragraph() self.current_para = Paragraph()
self.current_block = self.book.create_text_block(textStyle=pb.textStyle, self.current_block = self.book.create_text_block(textStyle=pb.textStyle,
blockStyle=pb.blockStyle) blockStyle=pb.blockStyle)
elif tagname in ['p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']: elif tagname in ['p', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']:
src = self.get_text(tag)
if self.chapter_detection and tagname.startswith('h'): if self.chapter_detection and tagname.startswith('h'):
src = self.get_text(tag)
if self.chapter_regex.search(src): if self.chapter_regex.search(src):
if self.verbose: if self.verbose:
print 'Detected chapter', src print 'Detected chapter', src
self.end_page() self.end_page()
self.page_break_found = True self.page_break_found = True
self.end_current_para() self.end_current_para()
if not tag.contents or not ''.join(tag.contents).strip(): # Handle empty <p></p> elements if not tag.contents or not src.strip(): # Handle empty <p></p> elements
self.current_block.append(CR()) self.current_block.append(CR())
return return
self.lstrip_toggle = True self.lstrip_toggle = True