From fd1ef7e9ebdd6affd245efdea4c0f2bba213b8c3 Mon Sep 17 00:00:00 2001 From: Griatch Date: Sun, 1 Nov 2020 19:02:46 +0100 Subject: [PATCH] Changing tab characters for webclient. Resolve #2239. --- evennia/utils/ansi.py | 4 ++-- evennia/utils/text2html.py | 2 +- evennia/web/webclient/static/webclient/css/webclient.css | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/evennia/utils/ansi.py b/evennia/utils/ansi.py index 370dda870d..e954590fbb 100644 --- a/evennia/utils/ansi.py +++ b/evennia/utils/ansi.py @@ -85,8 +85,7 @@ class ANSIParser(object): to ANSI command sequences We also allow to escape colour codes - by prepending with a \ for xterm256, - an extra | for Merc-style codes + by prepending with an extra |. """ @@ -97,6 +96,7 @@ class ANSIParser(object): (r"|n", ANSI_NORMAL), # reset (r"|/", ANSI_RETURN), # line break (r"|-", ANSI_TAB), # tab + (r"|>", ANSI_SPACE * 4), # indent (4 spaces) (r"|_", ANSI_SPACE), # space (r"|*", ANSI_INVERSE), # invert (r"|^", ANSI_BLINK), # blinking text (very annoying and not supported by all clients) diff --git a/evennia/utils/text2html.py b/evennia/utils/text2html.py index 847466aff7..34fd11c9f1 100644 --- a/evennia/utils/text2html.py +++ b/evennia/utils/text2html.py @@ -308,7 +308,7 @@ class TextToHTMLparser(object): elif cdict["lineend"]: return "
" elif cdict["tab"]: - text = cdict["tab"].replace("\t", " " * self.tabstop) + text = cdict["tab"].replace("\t", " ") return text elif cdict["space"] or cdict["spacestart"]: text = cdict["space"] diff --git a/evennia/web/webclient/static/webclient/css/webclient.css b/evennia/web/webclient/static/webclient/css/webclient.css index 0ce0997c56..bc94b84ae8 100644 --- a/evennia/web/webclient/static/webclient/css/webclient.css +++ b/evennia/web/webclient/static/webclient/css/webclient.css @@ -27,7 +27,6 @@ body { } } - a:link, a:visited { color: inherit; } a:hover, a:active { color: inherit; font-weight: bold;} @@ -92,6 +91,12 @@ div {margin:0px;} background-color: #333; } +.tabspace { + white-space: pre; + tab-size: 4; + -moz-tab-size: 4; +} + /* Container surrounding entire client */ #clientwrapper { height: 100%;