mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
Fix bug in ml classes where some tags were missed.
This commit is contained in:
parent
b92c2dc002
commit
1fd7c704d2
@ -98,11 +98,12 @@ class FB2MLizer(object):
|
||||
return u''
|
||||
|
||||
tag = barename(elem.tag)
|
||||
tag_count = 0
|
||||
|
||||
if tag == 'img':
|
||||
fb2_text += '<image xlink:herf="#%s" />' % os.path.basename(elem.attrib['src'])
|
||||
|
||||
tag_count = 0
|
||||
if hasattr(elem, 'text') and elem.text != None and elem.text.strip() != '':
|
||||
|
||||
fb2_tag = TAG_MAP.get(tag, 'p')
|
||||
if fb2_tag and fb2_tag not in tag_stack:
|
||||
tag_count += 1
|
||||
@ -117,6 +118,7 @@ class FB2MLizer(object):
|
||||
fb2_text += '<%s>' % style_tag
|
||||
tag_stack.append(style_tag)
|
||||
|
||||
if hasattr(elem, 'text') and elem.text != None and elem.text.strip() != '':
|
||||
fb2_text += elem.text
|
||||
|
||||
for item in elem:
|
||||
|
@ -153,8 +153,6 @@ class PMLMLizer(object):
|
||||
#if style['page-break-before'] == 'always':
|
||||
# text += '\\p'
|
||||
|
||||
# Proccess tags that contain text.
|
||||
if hasattr(elem, 'text') and elem.text != None and elem.text.strip() != '':
|
||||
pml_tag = TAG_MAP.get(tag, None)
|
||||
if pml_tag and pml_tag not in tag_stack:
|
||||
tag_count += 1
|
||||
@ -186,6 +184,8 @@ class PMLMLizer(object):
|
||||
tag_stack.append(style_tag)
|
||||
# margin
|
||||
|
||||
# Proccess tags that contain text.
|
||||
if hasattr(elem, 'text') and elem.text != None and elem.text.strip() != '':
|
||||
text += self.elem_text(elem, tag_stack)
|
||||
|
||||
for item in elem:
|
||||
|
Loading…
x
Reference in New Issue
Block a user