mirror of
https://github.com/evennia/evennia.git
synced 2026-03-25 01:06:32 +01:00
Added ansi.strip_ansi as a convenience shortcut to remove ansi markup from a string.
This commit is contained in:
parent
8d37627dfe
commit
8c5dddd062
1 changed files with 7 additions and 0 deletions
|
|
@ -354,6 +354,13 @@ def parse_ansi(string, strip_ansi=False, parser=ANSI_PARSER, xterm256=False, mxp
|
|||
return parser.parse_ansi(string, strip_ansi=strip_ansi, xterm256=xterm256, mxp=mxp)
|
||||
|
||||
|
||||
def strip_ansi(string, parser=ANSI_PARSER):
|
||||
"""
|
||||
Strip all ansi from the string.
|
||||
|
||||
"""
|
||||
return parser.parse_ansi(string, strip_ansi=True)
|
||||
|
||||
def strip_raw_ansi(string, parser=ANSI_PARSER):
|
||||
"""
|
||||
Remove raw ansi codes from string
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue