mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit Book: Fix style attribute on <html> tags not being preserved. Fixes #1810193 [ebook-edit drops STYLE attribute from HTML tags](https://bugs.launchpad.net/calibre/+bug/1810193)
This commit is contained in:
parent
84326d407c
commit
dde3ae0416
@ -59,6 +59,7 @@ def node_from_path(root, path):
|
||||
parent = parent[idx]
|
||||
return parent
|
||||
|
||||
|
||||
mychr = chr if ispy3 else unichr
|
||||
|
||||
|
||||
@ -227,6 +228,8 @@ class Chunker(object):
|
||||
attrib = {'lang':lang} if lang else {}
|
||||
if 'class' in root.attrib:
|
||||
attrib['class'] = root.attrib['class']
|
||||
if 'style' in root.attrib:
|
||||
attrib['style'] = root.attrib['style']
|
||||
nroot = etree.Element('html', attrib=attrib)
|
||||
nroot.text = root.text
|
||||
nroot.tail = '\n'
|
||||
@ -442,5 +445,3 @@ class Chunker(object):
|
||||
'tool on the orig and rebuilt directories')
|
||||
else:
|
||||
self.log('Skeleton HTML before and after is identical.')
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user