diff --git a/evennia/utils/text2html.py b/evennia/utils/text2html.py index 328e28d236..6a6e38afda 100644 --- a/evennia/utils/text2html.py +++ b/evennia/utils/text2html.py @@ -93,8 +93,8 @@ class TextToHTMLparser(object): re_hilite = re.compile("(?:%s)(.*)(?=%s)" % (hilite.replace("[", r"\["), fgstop)) re_uline = re.compile("(?:%s)(.*?)(?=%s)" % (ANSI_UNDERLINE.replace("[", r"\["), fgstop)) re_string = re.compile(r'(?P[<&>])|(?P [ \t]+)|(?P\r\n|\r|\n)', re.S|re.M|re.I) - re_link = re.compile(r'\{lc(.*?)\{lt(.*?)\{le', re.DOTALL) re_url = re.compile(r'((?:ftp|www|https?)\W+(?:(?!\.(?:\s|$)|&\w+;)[^"\',;$*^\\(){}<>\[\]\s])+)(\.(?:\s|$)|&\w+;|)') + re_mxplink = re.compile(r'\|lc(.*?)\|lt(.*?)\|le', re.DOTALL) def re_color(self, text): """ @@ -211,9 +211,7 @@ class TextToHTMLparser(object): text (str): Processed text. """ - html = "\\2" - repl = self.re_link.sub(html, text) - return repl + return self.re_mxplink.sub(r"""\2""", text) def do_sub(self, match): """