diff --git a/src/calibre/gui2/tweak_book/boss.py b/src/calibre/gui2/tweak_book/boss.py index cabc3e8eb0..fd04f3cb62 100644 --- a/src/calibre/gui2/tweak_book/boss.py +++ b/src/calibre/gui2/tweak_book/boss.py @@ -1065,7 +1065,7 @@ class Boss(QObject): editor = editors.pop(name) self.gui.central.close_editor(editor) editor.break_cycles() - if not editors: + if not editors or getattr(self.gui.central.current_editor, 'syntax', None) != 'html': self.gui.preview.clear() def insert_character(self):