From 7d6a37a043b1b4c33c0e248d8ffea623682af8f5 Mon Sep 17 00:00:00 2001 From: oddluck <39967334+oddluck@users.noreply.github.com> Date: Sun, 2 Feb 2020 12:48:00 +0000 Subject: [PATCH] Jeopardy: Normalize whitespace. --- Jeopardy/plugin.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Jeopardy/plugin.py b/Jeopardy/plugin.py index fe7134e..34b5435 100644 --- a/Jeopardy/plugin.py +++ b/Jeopardy/plugin.py @@ -166,6 +166,7 @@ class Jeopardy(callbacks.Plugin): if len(clue) > 1 and airdate and answer and category and not invalid and id not in self.history[channel]: q = "#{0}*({1}) [${2}] \x02{3}: {4}\x0F*{5}*{6}".format(id, airdate[0], str(points), category, clue, answer, points) q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape') + q = " ".join(q.split()) self.questions.append(q) n += 1 except Exception: @@ -220,6 +221,7 @@ class Jeopardy(callbacks.Plugin): if len(clue) > 1 and airdate and answer and category and not invalid and id not in self.history[channel]: q = "#{0}*({1}) [${2}] \x02{3}: {4}\x0F*{5}*{6}".format(id, airdate[0], str(points), category, clue, answer, points) q = re.sub('<[^<]+?>', '', fix_text(q, normalization='NFKC')).encode('utf-8').decode('unicode_escape') + q = " ".join(q.split()) self.questions.append(q) n += 1 j += 1