Fixed CJK bug in gSearch.lua.

Title truncation on line 61 was breaking encoding of long characters.
We'll let Telegram's built-in link truncation handle this for now.
This commit is contained in:
topkecleon 2016-02-14 03:36:25 -05:00
parent 3e16135fcd
commit 9d43f1ed8c

View File

@ -57,9 +57,11 @@ local action = function(msg)
local output = '*Google results for* _' .. input .. '_ *:*\n'
for i,v in ipairs(jdat.responseData.results) do
local title = jdat.responseData.results[i].titleNoFormatting:gsub('%[.+%]', ''):gsub('&', '&')
--[[
if title:len() > 48 then
title = title:sub(1, 45) .. '...'
end
]]--
local url = jdat.responseData.results[i].unescapedUrl
if url:find('%)') then
output = output .. '' .. title .. '\n' .. url:gsub('_', '\\_') .. '\n'