From eaf379bf88ae0bc620b4a1de23e58b75626778ad Mon Sep 17 00:00:00 2001 From: Brayden Date: Thu, 25 Feb 2016 20:50:51 -0800 Subject: [PATCH] Fix title escaping --- plugins/wikipedia.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/wikipedia.lua b/plugins/wikipedia.lua index b947083..146e1d3 100755 --- a/plugins/wikipedia.lua +++ b/plugins/wikipedia.lua @@ -72,7 +72,8 @@ local action = function(msg) title = title:gsub('%(.+%)', '') --local output = '[' .. title .. '](' .. url .. ')\n' .. text:gsub('%[.+]%','') --local output = '*' .. title .. '*\n' .. text:gsub('%[.+]%','') .. '\n[Read more.](' .. url .. ')' - local output = text:gsub('%[.+%]',''):gsub(title, '*'..title..'*') .. '\n' + local esctitle = title:gsub("[%^$()%%.%[%]*+%-?]","%%%1") + local output = text:gsub('%[.+%]',''):gsub(esctitle, '*%1*') .. '\n' if url:find('%(') then output = output .. url:gsub('_', '\\_') else