Quantcast

truncate quotes when they are too long

Eloi Charpentier [12-11-20 - 07:07]
truncate quotes when they are too long
Filename
Kaamelol.lua
diff --git a/Kaamelol.lua b/Kaamelol.lua
index f7c7c6d..f35fa33 100644
--- a/Kaamelol.lua
+++ b/Kaamelol.lua
@@ -51,7 +51,11 @@ function kaamelol_search(msg)
 		local file = entry["FILE"]

 		if string.find(string.upper(title), string.upper(msg)) then
-			print(i, file, ":", title)
+			max_length = 256
+			if string.len(title) > max_length then
+				title = string.sub(title, 1, max_length) .. '...'
+			end
+			print(i, ":", title)
 		end
 	end
     return true