DOCX Output: Add support for <hr>

This commit is contained in:
Kovid Goyal 2015-05-12 13:21:56 +05:30
parent ae91363a68
commit 87cbf338c1
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,4 @@
Table of Contents Table of Contents
<hr> tag (probably as an empty block with a border)
Various TODOs sprinkled through the source Various TODOs sprinkled through the source
List image bullet List image bullet
Cover image Cover image

View File

@ -487,6 +487,9 @@ class Convert(object):
# Image is floating so dont start a new paragraph for it # Image is floating so dont start a new paragraph for it
self.add_inline_tag(tagname, html_tag, tag_style, stylizer) self.add_inline_tag(tagname, html_tag, tag_style, stylizer)
else: else:
if tagname == 'hr':
for edge in 'right bottom left'.split():
tag_style.set('border-%s-style' % edge, 'none')
self.add_block_tag(tagname, html_tag, tag_style, stylizer, float_spec=float_spec) self.add_block_tag(tagname, html_tag, tag_style, stylizer, float_spec=float_spec)
for child in html_tag.iterchildren('*'): for child in html_tag.iterchildren('*'):