From e19d2e1e843bd139b6c1583e4b5d40466e8279b3 Mon Sep 17 00:00:00 2001 From: topkecleon Date: Tue, 26 Jul 2016 17:50:31 -0400 Subject: [PATCH] patterns.lua Trim whitespace off the ends of strings (partial fix for https://github.com/topkecleon/otouto/issues/74). Make output style consistent with translate.lua. --- otouto/plugins/patterns.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/otouto/plugins/patterns.lua b/otouto/plugins/patterns.lua index 82eb8fd..bc44b60 100644 --- a/otouto/plugins/patterns.lua +++ b/otouto/plugins/patterns.lua @@ -25,8 +25,8 @@ function patterns:action(msg) utilities.send_reply(self, msg, 'Malformed pattern!') else output = output:sub(1, 4000) - output = 'Did you mean:\n"' .. output .. '"' - utilities.send_reply(self, msg.reply_to_message, output) + output = '*Did you mean:*\n"' .. utilities.md_escape(utilities.trim(output)) .. '"' + utilities.send_reply(self, msg.reply_to_message, output, true) end end