All checks were successful
forgejo/Czech Quests/addon/pipeline/head This commit looks good
17 lines
No EOL
504 B
Lua
17 lines
No EOL
504 B
Lua
local _, addon = ...
|
|
|
|
local function ClearStringFormatMarks(text)
|
|
-- Remove colors (|cffffff...)
|
|
text = text:gsub("|c%x%x%x%x%x%x%x%x", "")
|
|
-- Remove H marks
|
|
text = text:gsub("|H.-|h", "")
|
|
return text
|
|
end
|
|
addon.API.ClearStringFormatMarks = ClearStringFormatMarks
|
|
|
|
local function ColorSpellNames(text, color)
|
|
return text:gsub("%[(.-)%]", function(match)
|
|
return string.format("|c%s[%s]|r", color or "FF0000FF", match)
|
|
end)
|
|
end
|
|
addon.API.ColorSpellNames = ColorSpellNames |