jump newline when ending a <p> element in html. Fixes #6880

This commit is contained in:
Yann Leboulanger 2011-07-24 21:45:57 +02:00
parent 611eb69e73
commit 404ca3a68f
1 changed files with 3 additions and 3 deletions

View File

@ -794,7 +794,7 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
elif name in ('a', 'img', 'body', 'html'): elif name in ('a', 'img', 'body', 'html'):
pass pass
elif name in INLINE: elif name in INLINE:
self._jump_line() pass
else: else:
log.warning('Unhandled element "%s"' % name) log.warning('Unhandled element "%s"' % name)
@ -830,6 +830,8 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
elif name in BLOCK: elif name in BLOCK:
if name == 'pre': if name == 'pre':
endPreserving = True endPreserving = True
elif name in BLOCK_STRUCT:
newLine = True
else: else:
log.warning("Unhandled element '%s'" % name) log.warning("Unhandled element '%s'" % name)
self._flush_text() self._flush_text()
@ -838,8 +840,6 @@ class HtmlHandler(xml.sax.handler.ContentHandler):
if newLine: if newLine:
self._jump_line() self._jump_line()
self._end_span() self._end_span()
#if not self._starts_line():
# self.text = ' '
class HtmlTextView(gtk.TextView): class HtmlTextView(gtk.TextView):