From 9442cbf38de45d2c5ee2b571ab621d9d0c147b70 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 1 Jan 2014 07:58:46 +0530 Subject: [PATCH] Edit book: Fix live replacement of entities not working on some non-US keyboard layouts. Fixes #1265147 [Editor: HTML entities replacement doesn't work in Calibre 64-bit for windows](https://bugs.launchpad.net/calibre/+bug/1265147) --- src/calibre/gui2/tweak_book/editor/text.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index 66e4148b79..c0c1e7e2bc 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 and tprefs['replace_entities_as_typed'] and self.syntax == 'html': + if (ev.key() == Qt.Key_Semicolon or unicode(ev.text()) == ';') and tprefs['replace_entities_as_typed'] and self.syntax == 'html': self.replace_possible_entity() def replace_possible_entity(self):