MOBI Output: Do not ignore an empty anchor at the end of a block element.

This commit is contained in:
Kovid Goyal 2011-12-06 10:53:57 +05:30
parent 1aa2dc2a3c
commit b6abccf853

View File

@ -540,7 +540,11 @@ class MobiMLizer(object):
old_mim = self.opts.mobi_ignore_margins
self.opts.mobi_ignore_margins = False
if text or tag in CONTENT_TAGS or tag in NESTABLE_TAGS:
if (text or tag in CONTENT_TAGS or tag in NESTABLE_TAGS or (
# We have an id but no text and no children, the id should still
# be added.
istate.ids and tag in ('a', 'span', 'i', 'b', 'u') and
len(elem)==0)):
self.mobimlize_content(tag, text, bstate, istates)
for child in elem:
self.mobimlize_elem(child, stylizer, bstate, istates)