mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
[SNBOutput] Fixed a bug in handling pre tag.
This commit is contained in:
parent
fec3cb8375
commit
ce9f35a6cc
@ -101,11 +101,12 @@ class SNBMLizer(object):
|
|||||||
subitem = ''
|
subitem = ''
|
||||||
bodyTree = trees[subitem].find(".//body")
|
bodyTree = trees[subitem].find(".//body")
|
||||||
for line in output.splitlines():
|
for line in output.splitlines():
|
||||||
if not line.find(CALIBRE_SNB_PRE_TAG) == 0:
|
pos = line.find(CALIBRE_SNB_PRE_TAG)
|
||||||
|
if pos == -1:
|
||||||
line = line.strip(u' \t\n\r\u3000')
|
line = line.strip(u' \t\n\r\u3000')
|
||||||
else:
|
else:
|
||||||
etree.SubElement(bodyTree, "text").text = \
|
etree.SubElement(bodyTree, "text").text = \
|
||||||
etree.CDATA(line[len(CALIBRE_SNB_PRE_TAG):])
|
etree.CDATA(line[pos+len(CALIBRE_SNB_PRE_TAG):])
|
||||||
continue
|
continue
|
||||||
if len(line) != 0:
|
if len(line) != 0:
|
||||||
if line.find(CALIBRE_SNB_IMG_TAG) == 0:
|
if line.find(CALIBRE_SNB_IMG_TAG) == 0:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user