mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix bug #3941: Handle input with <br> separated paragraphs better.
This commit is contained in:
parent
155fd8a9e6
commit
c2d9b2e6ad
@ -30,7 +30,7 @@ TAG_MAP = {
|
|||||||
'i' : 'emphasis',
|
'i' : 'emphasis',
|
||||||
'p' : 'p',
|
'p' : 'p',
|
||||||
'li' : 'p',
|
'li' : 'p',
|
||||||
'br' : 'empty-line',
|
'br' : 'p',
|
||||||
}
|
}
|
||||||
|
|
||||||
TAG_SPACE = [
|
TAG_SPACE = [
|
||||||
@ -227,8 +227,14 @@ class FB2MLizer(object):
|
|||||||
fb2_text.append(self.get_anchor(page, id_name))
|
fb2_text.append(self.get_anchor(page, id_name))
|
||||||
|
|
||||||
fb2_tag = TAG_MAP.get(tag, None)
|
fb2_tag = TAG_MAP.get(tag, None)
|
||||||
if fb2_tag and fb2_tag not in tag_stack:
|
if fb2_tag:
|
||||||
|
if fb2_tag not in tag_stack:
|
||||||
tag_count += 1
|
tag_count += 1
|
||||||
|
else:
|
||||||
|
tag_stack.reverse()
|
||||||
|
tag_stack.remove(fb2_tag)
|
||||||
|
tag_stack.reverse()
|
||||||
|
fb2_text.append('</%s>' % fb2_tag)
|
||||||
fb2_text.append('<%s>' % fb2_tag)
|
fb2_text.append('<%s>' % fb2_tag)
|
||||||
tag_stack.append(fb2_tag)
|
tag_stack.append(fb2_tag)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user