From db218f729383a73fd15c3375289efee74c3928ba Mon Sep 17 00:00:00 2001 From: Dan Feeney Date: Sun, 8 Nov 2015 18:12:29 -0600 Subject: [PATCH] fixed regexp used in text2html's convert_urls function and moved it to the block of other parsed regex in the module --- evennia/utils/text2html.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/evennia/utils/text2html.py b/evennia/utils/text2html.py index 4cce54de5d..e49cbdca24 100644 --- a/evennia/utils/text2html.py +++ b/evennia/utils/text2html.py @@ -81,6 +81,7 @@ class TextToHTMLparser(object): 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|http)\W+[^"\',;$*^\\()[\]{}<>\s]+)') def re_color(self, text): """ @@ -181,10 +182,9 @@ class TextToHTMLparser(object): text (str): Processed text. """ - regexp = r"((ftp|www|http)(\W+\S+[^).,:;?\]\}(\) \r\n$\"\']+))" # -> added target to output prevent the web browser from attempting to # change pages (and losing our webclient session). - return re.sub(regexp, r'\1', text) + return re_url.sub(r'\1', text) def convert_links(self, text): """