From 814784b2f88dc319babd6580e8da4b54d97bda97 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 14 Sep 2022 10:29:05 +0530 Subject: [PATCH] Comments editor: Workaround for Qt inserting invalid font-weight when converting a paragraph to a heading. Fixes #1989177 [Comment heading with invalide weight](https://bugs.launchpad.net/calibre/+bug/1989177) --- src/calibre/gui2/comments_editor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/comments_editor.py b/src/calibre/gui2/comments_editor.py index 7b8538cfbc..ac7dcc3d9b 100644 --- a/src/calibre/gui2/comments_editor.py +++ b/src/calibre/gui2/comments_editor.py @@ -103,7 +103,7 @@ def remove_heading_font_styles(tag, style): expected_size = (None, 'xx-large', 'x-large', 'large', None, 'small', 'x-small')[lvl] if style.get('font-size', 1) == expected_size: del style['font-size'] - if style.get('font-weight') in ('600', '700', 'bold'): + if style.get('font-weight') in ('0', '600', '700', 'bold'): del style['font-weight']