From 6f97695dff71344ab583ec3ab8922f851a495bbf Mon Sep 17 00:00:00 2001 From: Aldric Ducreux Date: Sat, 4 May 2024 03:21:08 +0200 Subject: [PATCH] remove special char from extralinetext key --- helper/Utils.lua | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/helper/Utils.lua b/helper/Utils.lua index 96bbeeb..6a376f7 100644 --- a/helper/Utils.lua +++ b/helper/Utils.lua @@ -52,12 +52,13 @@ function AprRC:GetItemIDFromLink(link) end function AprRC:ExtraLineTextToKey(inputString) - local result = string.gsub(inputString, "%s", "_") - result = string.gsub(result, "_a_", "_") - result = string.gsub(result, "_of_", "_") - result = string.gsub(result, "_the_", "_") - result = string.gsub(result, "__", "_") - result = string.gsub(result, "'", "") + local result = string.gsub(inputString, "_(a|of|the)_", " ") + result = string.gsub(result, " - ", " ") + result = string.gsub(result, "-", " ") + result = string.gsub(result, "[+='\"`$£€°~^¨<>|#&;,%.:§?!*/(){}%[%]]", "") + result = string.gsub(result, "%s", "_") + result = string.gsub(result, "__+", "_") + result = string.gsub(result, "_+$", "") result = string.upper(result) return result