mirror of
https://github.com/luanti-org/luanti.git
synced 2025-09-15 18:57:08 +00:00
Add core.strip_escapes() (#16485)
This commit is contained in:
parent
cc6b56b034
commit
d932f34693
8 changed files with 52 additions and 17 deletions
|
@ -658,7 +658,7 @@ function core.colorize(color, message)
|
|||
lines[i] = color_code .. line
|
||||
end
|
||||
|
||||
return table.concat(lines, "\n") .. core.get_color_escape_sequence("#ffffff")
|
||||
return table.concat(lines, "\n") .. core.get_color_escape_sequence("#fff")
|
||||
end
|
||||
|
||||
|
||||
|
@ -674,6 +674,7 @@ function core.strip_colors(str)
|
|||
return (str:gsub(ESCAPE_CHAR .. "%([bc]@[^)]+%)", ""))
|
||||
end
|
||||
|
||||
|
||||
local function translate(textdomain, str, num, ...)
|
||||
local start_seq
|
||||
if textdomain == "" and num == "" then
|
||||
|
|
|
@ -182,7 +182,7 @@ local function format_statistics(profile, format, filter, enable_translation)
|
|||
formatter:format(filter)
|
||||
local out = formatter:flush()
|
||||
if not enable_translation then
|
||||
out = core.get_translated_string("en", out)
|
||||
out = core.strip_escapes(out)
|
||||
end
|
||||
return out
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue