diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index c0c1e7e2bc..df39d48665 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -545,7 +545,7 @@ class TextEdit(QPlainTextEdit): def keyPressEvent(self, ev): QPlainTextEdit.keyPressEvent(self, ev) - if (ev.key() == Qt.Key_Semicolon or unicode(ev.text()) == ';') and tprefs['replace_entities_as_typed'] and self.syntax == 'html': + if (ev.key() == Qt.Key_Semicolon or ';' in unicode(ev.text())) and tprefs['replace_entities_as_typed'] and self.syntax == 'html': self.replace_possible_entity() def replace_possible_entity(self):