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
@ -257,6 +257,8 @@ class HTMLConverter(object, LoggingInterface):
|
|||||||
if npcss:
|
if npcss:
|
||||||
update_css(npcss, self.override_pcss)
|
update_css(npcss, self.override_pcss)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
paths = [os.path.abspath(path) for path in paths]
|
paths = [os.path.abspath(path) for path in paths]
|
||||||
|
|
||||||
while len(paths) > 0 and self.link_level <= self.link_levels:
|
while len(paths) > 0 and self.link_level <= self.link_levels:
|
||||||
@ -355,7 +357,11 @@ class HTMLConverter(object, LoggingInterface):
|
|||||||
def add_file(self, path):
|
def add_file(self, path):
|
||||||
self.css = HTMLConverter.CSS.copy()
|
self.css = HTMLConverter.CSS.copy()
|
||||||
self.pseudo_css = self.override_pcss.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.file_name = os.path.basename(path)
|
||||||
self.log_info(_('Processing %s'), path if self.verbose else self.file_name)
|
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()
|
ts = self.current_block.textStyle.copy()
|
||||||
self.current_block.textStyle = ts
|
self.current_block.textStyle = ts
|
||||||
self.current_block.textStyle.attrs['parindent'] = '0'
|
self.current_block.textStyle.attrs['parindent'] = '0'
|
||||||
|
print tag_css
|
||||||
if tag.contents:
|
if tag.contents:
|
||||||
c = tag.contents[0]
|
c = tag.contents[0]
|
||||||
if isinstance(c, NavigableString):
|
if isinstance(c, NavigableString):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user