From 01a61db2f8318b1a76a22881940f2a250d55c7a1 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Tue, 6 Dec 2016 13:24:22 -0500 Subject: [PATCH] Unescape html escape sequences Python has a handy module for this, so let's use it to fix escape codes in messages. Signed-off-by: Anna Schumaker --- slack/chat.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/slack/chat.py b/slack/chat.py index 3ffed6f..701e538 100644 --- a/slack/chat.py +++ b/slack/chat.py @@ -5,6 +5,7 @@ from . import api from . import auth from . import users from datetime import datetime +import html import textwrap import re @@ -65,7 +66,7 @@ class Message: line = line.replace("[#####]", "[%s]" % count, 1) count += 1 - lines += [ "" ] + textwrap.wrap(line) + lines += [ "" ] + textwrap.wrap(html.unescape(line)) links += link if len(lines) == 0: