Fixed irresponsiveness in gSearch.lua when dealing with CJK characters.
Resolved issue #34. Result title truncation was screwing with CJK encoding. Will rely on Telegram's built-in link truncation for now.
This commit is contained in:
parent
a0e1eccd46
commit
f65e145bc3
@ -57,9 +57,11 @@ local action = function(msg)
|
|||||||
local output = '*Google results for* _' .. input .. '_ *:*\n'
|
local output = '*Google results for* _' .. input .. '_ *:*\n'
|
||||||
for i,v in ipairs(jdat.responseData.results) do
|
for i,v in ipairs(jdat.responseData.results) do
|
||||||
local title = jdat.responseData.results[i].titleNoFormatting:gsub('%[.+%]', ''):gsub('&', '&')
|
local title = jdat.responseData.results[i].titleNoFormatting:gsub('%[.+%]', ''):gsub('&', '&')
|
||||||
|
--[[
|
||||||
if title:len() > 48 then
|
if title:len() > 48 then
|
||||||
title = title:sub(1, 45) .. '...'
|
title = title:sub(1, 45) .. '...'
|
||||||
end
|
end
|
||||||
|
]]--
|
||||||
local url = jdat.responseData.results[i].unescapedUrl
|
local url = jdat.responseData.results[i].unescapedUrl
|
||||||
if url:find('%)') then
|
if url:find('%)') then
|
||||||
output = output .. '• ' .. title .. '\n' .. url:gsub('_', '\\_') .. '\n'
|
output = output .. '• ' .. title .. '\n' .. url:gsub('_', '\\_') .. '\n'
|
||||||
|
Reference in New Issue
Block a user