mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
ODT Input: Fix handling of the <text:s> element. Fixes #749655 (Private bug)
This commit is contained in:
parent
1d84c0d6ac
commit
492d16e5c9
@ -1386,12 +1386,19 @@ ol, ul { padding-left: 2em; }
|
||||
self.purgedata()
|
||||
|
||||
def s_text_s(self, tag, attrs):
|
||||
""" Generate a number of spaces. ODF has an element; HTML uses
|
||||
We use   so we can send the output through an XML parser if we desire to
|
||||
# Changed by Kovid to fix non breaking spaces being prepended to
|
||||
# element instead of being part of the text flow.
|
||||
# We don't use an entity for the nbsp as the contents of self.data will
|
||||
# be escaped on writeout.
|
||||
""" Generate a number of spaces. We use the non breaking space for
|
||||
the text:s ODF element.
|
||||
"""
|
||||
c = attrs.get( (TEXTNS,'c'),"1")
|
||||
for x in xrange(int(c)):
|
||||
self.writeout(' ')
|
||||
try:
|
||||
c = int(attrs.get((TEXTNS, 'c'), 1))
|
||||
except:
|
||||
c = 0
|
||||
if c > 0:
|
||||
self.data.append(u'\u00a0'*c)
|
||||
|
||||
def s_text_span(self, tag, attrs):
|
||||
""" The <text:span> element matches the <span> element in HTML. It is
|
||||
|
Loading…
x
Reference in New Issue
Block a user