Fix handling of HTML files with <hr> as the first element

This commit is contained in:
Kovid Goyal 2007-05-10 20:26:18 +00:00
parent 9026e54fbf
commit be8345b0c2
2 changed files with 6 additions and 4 deletions

View File

@ -430,6 +430,7 @@ class HTMLConverter(object):
def get_text(self, tag):
css = self.tag_css(tag)
if css.has_key('display') and css['display'].lower() == 'none':

View File

@ -632,8 +632,8 @@ class TableOfContents(object):
def addTocEntry(self, tocLabel, textBlock):
if not isinstance(textBlock, (TextBlock, ImageBlock)):
raise LrsError, "TOC destination must be a TextBlock or ImageBlock"+\
if not isinstance(textBlock, (TextBlock, ImageBlock, RuledLine)):
raise LrsError, "TOC destination must be a TextBlock, ImageBlock or RuledLine"+\
" not a " + str(type(textBlock))
if textBlock.parent is None or not isinstance(textBlock.parent, Page):
@ -1968,7 +1968,7 @@ class JumpButton(LrsObject, LrsContainer):
class RuledLine(LrsContainer, LrsAttributes):
class RuledLine(LrsContainer, LrsAttributes, LrsObject):
""" A line. Default is 500 pixels long, 2 pixels wide. """
defaults = dict(
@ -1978,6 +1978,7 @@ class RuledLine(LrsContainer, LrsAttributes):
def __init__(self, **settings):
LrsContainer.__init__(self, [])
LrsAttributes.__init__(self, self.defaults, **settings)
LrsObject.__init__(self)
def toLrfContainer(self, lrfWriter, container):