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)

This commit is contained in:
Kovid Goyal 2014-01-01 07:58:46 +05:30
parent 402bd2bb77
commit 9442cbf38d

View File

@ -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):