Changing tab characters for webclient. Resolve #2239.

This commit is contained in:
Griatch 2020-11-01 19:02:46 +01:00
parent dedb1b3d66
commit fd1ef7e9eb
3 changed files with 9 additions and 4 deletions

View file

@ -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)

View file

@ -308,7 +308,7 @@ class TextToHTMLparser(object):
elif cdict["lineend"]:
return "<br>"
elif cdict["tab"]:
text = cdict["tab"].replace("\t", "&nbsp;" * self.tabstop)
text = cdict["tab"].replace("\t", "<span class=\"tabspace\">&#0009;</span>")
return text
elif cdict["space"] or cdict["spacestart"]:
text = cdict["space"]

View file

@ -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%;