From 4e4cb936c9c6c066982114727e9dcc80ca1a8b72 Mon Sep 17 00:00:00 2001 From: Wofsauge Date: Mon, 19 Oct 2020 22:14:58 +0200 Subject: [PATCH] Fixed issue where getIcon worked for non encapsuled Strings --- eid_api.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/eid_api.lua b/eid_api.lua index 913b92e5..9f6f93c0 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -185,7 +185,12 @@ end -- Returns the inlineIcon object of a given Iconstring -- can be used to validate an iconstring function EID:getIcon(str) - return EID.InlineIcons[string.gsub(str, "{{(.-)}}", function(a) return a end)] or nil + local strTrimmed = string.gsub(str, "{{(.-)}}", function(a) return a end) + if #strTrimmed < #str then + return EID.InlineIcons[strTrimmed] or nil + else + return nil + end end -- Returns the width of a given string in Pixels