fix: title deduplication matching not escaping pattern parameter

ref #455
This commit is contained in:
tomasklaen
2023-02-18 10:58:09 +01:00
parent 0bc28c213c
commit 2e5b0cc834

View File

@@ -101,7 +101,8 @@ function TopBar:decide_titles()
longer_title, shorter_title = self.main_title, self.alt_title
end
if string.match(longer_title --[[@as string]], shorter_title --[[@as string]]) then
local escaped_shorter_title = string.gsub(shorter_title --[[@as string]], "[%(%)%.%+%-%*%?%[%]%^%$%%]", "%%%1")
if string.match(longer_title --[[@as string]], escaped_shorter_title) then
self.main_title, self.alt_title = longer_title, nil
end
end