mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
ODT Input: Handle inline special styles defined on <text:span> tags. Fixes #780250 (Italic text not converting from ODT source)
This commit is contained in:
parent
31e2bc3818
commit
231df586c0
@ -1415,18 +1415,34 @@ ol, ul { padding-left: 2em; }
|
||||
self.writedata()
|
||||
c = attrs.get( (TEXTNS,'style-name'), None)
|
||||
htmlattrs = {}
|
||||
# Changed by Kovid to handle inline apecial styles defined on <text:span> tags.
|
||||
# Apparently LibreOffice does this.
|
||||
special = 'span'
|
||||
if c:
|
||||
c = c.replace(".","_")
|
||||
special = special_styles.get("S-"+c)
|
||||
if special is None and self.generate_css:
|
||||
htmlattrs['class'] = "S-%s" % c
|
||||
self.opentag('span', htmlattrs)
|
||||
if special is None:
|
||||
special = 'span'
|
||||
if self.generate_css:
|
||||
htmlattrs['class'] = "S-%s" % c
|
||||
|
||||
self.opentag(special, htmlattrs)
|
||||
self.purgedata()
|
||||
|
||||
def e_text_span(self, tag, attrs):
|
||||
""" End the <text:span> """
|
||||
self.writedata()
|
||||
self.closetag('span', False)
|
||||
c = attrs.get( (TEXTNS,'style-name'), None)
|
||||
# Changed by Kovid to handle inline apecial styles defined on <text:span> tags.
|
||||
# Apparently LibreOffice does this.
|
||||
special = 'span'
|
||||
if c:
|
||||
c = c.replace(".","_")
|
||||
special = special_styles.get("S-"+c)
|
||||
if special is None:
|
||||
special = 'span'
|
||||
|
||||
self.closetag(special, False)
|
||||
self.purgedata()
|
||||
|
||||
def s_text_tab(self, tag, attrs):
|
||||
|
Loading…
x
Reference in New Issue
Block a user