From 16210639bcb2a6000a0d2a36634311bd5e2a4fd6 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 7 Feb 2013 19:50:00 +1300 Subject: [PATCH] Fixed another issue. --- plugins/answers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/answers.py b/plugins/answers.py index b16c779..da846bc 100644 --- a/plugins/answers.py +++ b/plugins/answers.py @@ -9,6 +9,8 @@ def answer(inp): result = web.query(query, {"query": inp.strip()}).one() short_url = web.isgd(result["Link"]) - answer = text.truncate_str(result["ChosenAnswer"], 80) - return u"\x02{}\x02 {} - {}".format(result["Subject"], answer, short_url) \ No newline at end of file + # we split the answer and .join() it to remove newlines/extra spaces + answer = text.truncate_str(" ".join(result["ChosenAnswer"].split()), 80) + + return u"\x02{}\x02 \"{}\" - {}".format(result["Subject"], answer, short_url) \ No newline at end of file