From 400bc9be54eaed1ea3470ed48d8dcc6856e53cac Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 27 Apr 2023 19:55:49 +0530 Subject: [PATCH] ... --- src/calibre/gui2/markdown_syntax_highlighter.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/calibre/gui2/markdown_syntax_highlighter.py b/src/calibre/gui2/markdown_syntax_highlighter.py index f62c714588..7079ac6185 100644 --- a/src/calibre/gui2/markdown_syntax_highlighter.py +++ b/src/calibre/gui2/markdown_syntax_highlighter.py @@ -99,10 +99,8 @@ class MarkdownHighlighter(QSyntaxHighlighter): format = QTextCharFormat() if 'color' in subtheme: format.setForeground(QBrush(QColor(subtheme['color']))) - if 'font-weight' in subtheme: - format.setFontWeight(QFont.Weight.Bold if subtheme['font-weight']=='bold' else QFont.Weight.Normal) - if 'font-style' in subtheme: - format.setFontItalic(True if subtheme['font-style']=='italic' else False) + format.setFontWeight(QFont.Weight.Bold if subtheme.get('font-weight') == 'bold' else QFont.Weight.Normal) + format.setFontItalic(subtheme.get('font-style') == 'italic') self.MARKDOWN_KWS_FORMAT[k] = format self.rehighlight()