diff -r 2bbec88047dd -r 2161475d9639 eric6/UI/Previewers/PreviewerHTML.py --- a/eric6/UI/Previewers/PreviewerHTML.py Wed Apr 21 19:40:50 2021 +0200 +++ b/eric6/UI/Previewers/PreviewerHTML.py Thu Apr 22 18:02:47 2021 +0200 @@ -238,10 +238,11 @@ self.__restoreScrollBarPositions) if not filePath: filePath = "/" - if rootPath: - baseUrl = QUrl.fromLocalFile(rootPath + "/index.html") - else: - baseUrl = QUrl.fromLocalFile(filePath) + baseUrl = ( + QUrl.fromLocalFile(rootPath + "/index.html") + if rootPath else + QUrl.fromLocalFile(filePath) + ) self.previewView.setHtml(html, baseUrl=baseUrl) if self.__previewedEditor: self.__previewedEditor.setFocus() @@ -766,16 +767,13 @@ htmlFormat = Preferences.getEditor("PreviewMarkdownHTMLFormat").lower() body = markdown.markdown(text, extensions=extensions, output_format=htmlFormat.lower()) - if e5App().usesDarkPalette(): - 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 e5App().usesDarkPalette() else + (PreviewerHTMLStyles.css_markdown_light + + PreviewerHTMLStyles.css_pygments_light) + ) if htmlFormat == "xhtml1": head = (