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:
commit
4ee2991358
@ -101,11 +101,12 @@ class SNBMLizer(object):
|
||||
subitem = ''
|
||||
bodyTree = trees[subitem].find(".//body")
|
||||
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')
|
||||
else:
|
||||
etree.SubElement(bodyTree, "text").text = \
|
||||
etree.CDATA(line[len(CALIBRE_SNB_PRE_TAG):])
|
||||
etree.CDATA(line[pos+len(CALIBRE_SNB_PRE_TAG):])
|
||||
continue
|
||||
if len(line) != 0:
|
||||
if line.find(CALIBRE_SNB_IMG_TAG) == 0:
|
||||
|
Loading…
x
Reference in New Issue
Block a user