From f61f17d524f56bddae272057b0250971661567db Mon Sep 17 00:00:00 2001 From: Septatrix <24257556+Septatrix@users.noreply.github.com> Date: Sun, 8 Mar 2020 16:20:58 +0100 Subject: [PATCH] Revert some redundant changes --- sphinx/builders/html/__init__.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py index be61c4b55..a6a32f83c 100644 --- a/sphinx/builders/html/__init__.py +++ b/sphinx/builders/html/__init__.py @@ -241,10 +241,10 @@ class StandaloneHTMLBuilder(Builder): candidates = [path.join(dir, self.config.language, 'LC_MESSAGES', 'sphinx.js') for dir in self.config.locale_dirs] + \ - [path.join(package_dir, 'locale', self.config.language, - 'LC_MESSAGES', 'sphinx.js'), - path.join(sys.prefix, 'share/sphinx/locale', - self.config.language, 'sphinx.js')] + [path.join(package_dir, 'locale', self.config.language, + 'LC_MESSAGES', 'sphinx.js'), + path.join(sys.prefix, 'share/sphinx/locale', + self.config.language, 'sphinx.js')] for jsfile in candidates: if path.isfile(jsfile): @@ -264,18 +264,20 @@ class StandaloneHTMLBuilder(Builder): def init_highlighter(self) -> None: # determine Pygments style and create the highlighter - style = 'sphinx' if self.config.pygments_style is not None: style = self.config.pygments_style elif self.theme: style = self.theme.get_config('theme', 'pygments_style', 'none') + else: + style = 'sphinx' self.highlighter = PygmentsBridge('html', style) - dark_style = None if self.config.html_pygments_dark_style is not None: dark_style = self.config.pygments_dark_style elif self.theme: dark_style = self.theme.get_config('theme', 'pygments_dark_style', 'none') + else: + dark_style = None if dark_style is not None: self.dark_highlighter = PygmentsBridge('html', dark_style)