Commit 6a4fbd2f authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

share/luameta/googleimage.lua: Filter out extensions.

parent 51c792ff
......@@ -3,7 +3,9 @@
-- Replace non alphanumeric char by +
function get_query( title )
return string.gsub( title, "([^%w ])",
-- If we have a .EXT remove the extension.
str = string.gsub( title, "(.*)%....$", "%1" )
return string.gsub( str, "([^%w ])",
function (c) return string.format ("%%%02X", string.byte(c)) end)
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment