Refactor encounter rendering and description formatting
This commit is contained in:
parent
f37808207e
commit
a06edeb492
4 changed files with 213 additions and 32 deletions
|
@ -35,9 +35,9 @@ local function FillNumberPositionPlaceholder(text, sourceText)
|
|||
|
||||
if n then
|
||||
if source:match("%s+" .. n .. "%s+million") then
|
||||
return n .. "<mil>"
|
||||
return n .. " <mil>"
|
||||
elseif source:match("%s+" .. n .. "%s+millions") then
|
||||
return n .. "<mil>"
|
||||
return n .. " <mil>"
|
||||
else
|
||||
return n
|
||||
end
|
||||
|
@ -55,11 +55,11 @@ local function FormatEncounterDescription(text, original)
|
|||
formated = addon.API.ParseParagraphs(original, formated)
|
||||
formated = addon.API.ColorSpellNames(formated)
|
||||
|
||||
-- fix [mil]
|
||||
-- fix [mil], 4 s, 5 %
|
||||
formated = string.gsub(formated, "<mil>", "mil.")
|
||||
formated = string.gsub(formated, "(%d+) s([%s%.%,%?%!])", "%1s%2")
|
||||
formated = string.gsub(formated, "(%d+) %%([%s%.])", "%1%%%2")
|
||||
|
||||
-- fix 4 s
|
||||
formated = string.gsub(formated, "(%d+) s([%s%.])", "%1s%2")
|
||||
|
||||
return formated
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue