From 25aa026b28031773ccd40b32b25c77c57928a0b8 Mon Sep 17 00:00:00 2001 From: Griatch Date: Wed, 11 Sep 2019 20:02:24 +0200 Subject: [PATCH] ... and another fix to handle line breaks in web client --- evennia/utils/text2html.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/evennia/utils/text2html.py b/evennia/utils/text2html.py index 9c075a22dc..af12a39e98 100644 --- a/evennia/utils/text2html.py +++ b/evennia/utils/text2html.py @@ -99,7 +99,7 @@ class TextToHTMLparser(object): re_uline = re.compile("(?:%s)(.*?)(?=%s|%s)" % (underline.replace("[", r"\["), fgstop, bgstop)) re_blink = re.compile("(?:%s)(.*?)(?=%s|%s)" % (blink.replace("[", r"\["), fgstop, bgstop)) re_inverse = re.compile("(?:%s)(.*?)(?=%s|%s)" % (inverse.replace("[", r"\["), fgstop, bgstop)) - re_string = re.compile(r'(?P[<&>])|(?P(?<=\S) +)|(?P [ \t]+)|' + re_string = re.compile(r'(?P[<&>])|(?P(?<=\S) {2,})|(?P [ \t]+)|' r'(?P^ )|(?P\r\n|\r|\n)', re.S | re.M | re.I) re_url = re.compile(r'((?:ftp|www|https?)\W+(?:(?!\.(?:\s|$)|&\w+;)[^"\',;$*^\\(){}<>\[\]\s])+)(\.(?:\s|$)|&\w+;|)') re_mxplink = re.compile(r'\|lc(.*?)\|lt(.*?)\|le', re.DOTALL) @@ -294,6 +294,9 @@ class TextToHTMLparser(object): return cgi.escape(cdict['htmlchars']) elif cdict['lineend']: return '
' + elif cdict['firstspace']: + return '  ' + elif cdict['space'] == '\t': return ' ' * self.tabstop elif cdict['space'] or cdict["spacestart"] or cdict['firstspace']: