--- a/eric6/QScintilla/Exporters/ExporterHTML.py Wed Apr 21 17:56:12 2021 +0200 +++ b/eric6/QScintilla/Exporters/ExporterHTML.py Wed Apr 21 19:40:50 2021 +0200 @@ -122,10 +122,11 @@ ) lex = self.editor.getLexer() - if lex: - bgColour = lex.paper(QsciScintilla.STYLE_DEFAULT).name() - else: - bgColour = self.editor.paper().name() + bgColour = ( + lex.paper(QsciScintilla.STYLE_DEFAULT).name() + if lex else + self.editor.paper().name() + ) html += '''<style type="text/css">\n''' if lex: @@ -647,16 +648,13 @@ htmlFormat = Preferences.getEditor("PreviewMarkdownHTMLFormat").lower() body = markdown.markdown(text, extensions=extensions, output_format=htmlFormat) - if useDarkScheme: - style = ( - PreviewerHTMLStyles.css_markdown_dark + - PreviewerHTMLStyles.css_pygments_dark - ) - else: - style = ( - PreviewerHTMLStyles.css_markdown_light + - PreviewerHTMLStyles.css_pygments_light - ) + style = ( + (PreviewerHTMLStyles.css_markdown_dark + + PreviewerHTMLStyles.css_pygments_dark) + if useDarkScheme else + (PreviewerHTMLStyles.css_markdown_light + + PreviewerHTMLStyles.css_pygments_light) + ) if htmlFormat == "xhtml1": head = (