mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix --override-css to only override specified properties.
This commit is contained in:
parent
39950cf06d
commit
eb5d4a24b9
@ -256,6 +256,8 @@ class HTMLConverter(object, LoggingInterface):
|
||||
update_css(ncss, self.override_css)
|
||||
if npcss:
|
||||
update_css(npcss, self.override_pcss)
|
||||
|
||||
|
||||
|
||||
paths = [os.path.abspath(path) for path in paths]
|
||||
|
||||
@ -355,7 +357,11 @@ class HTMLConverter(object, LoggingInterface):
|
||||
def add_file(self, path):
|
||||
self.css = HTMLConverter.CSS.copy()
|
||||
self.pseudo_css = self.override_pcss.copy()
|
||||
self.css.update(self.override_css)
|
||||
for selector in self.override_css:
|
||||
if self.css.has_key(selector):
|
||||
self.css[selector].update(self.override_css[selector])
|
||||
else:
|
||||
self.css[selector] = self.override_css[selector]
|
||||
|
||||
self.file_name = os.path.basename(path)
|
||||
self.log_info(_('Processing %s'), path if self.verbose else self.file_name)
|
||||
@ -1490,6 +1496,7 @@ class HTMLConverter(object, LoggingInterface):
|
||||
ts = self.current_block.textStyle.copy()
|
||||
self.current_block.textStyle = ts
|
||||
self.current_block.textStyle.attrs['parindent'] = '0'
|
||||
print tag_css
|
||||
if tag.contents:
|
||||
c = tag.contents[0]
|
||||
if isinstance(c, NavigableString):
|
||||
|
Loading…
x
Reference in New Issue
Block a user