changeset e1d7291ab37c in /home/hg/repos/gajim-plugins
author: lovetox forenjunkie@chelo.at branches: details:gajim-plugins?cmd=changeset;node=e1d7291ab37c description: Handle unknown entities
diffstat:
gotr/otrmodule.py | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diffs (17 lines):
diff -r 678e16de4738 -r e1d7291ab37c gotr/otrmodule.py --- a/gotr/otrmodule.py Sun Oct 30 19:07:55 2016 +0100 +++ b/gotr/otrmodule.py Sun Oct 30 21:38:15 2016 +0100 @@ -707,8 +707,12 @@ self.stripped_data += '\n'
def handle_entityref(self, name): - c = unichr(name2codepoint[name]) + try: + c = unichr(name2codepoint[name]) + except KeyError: + c = '&{};'.format(name) self.stripped_data += c + def handle_charref(self, name): if name.startswith('x'): c = unichr(int(name[1:], 16))