diff --git a/src/server/initial_setup.py b/src/server/initial_setup.py index 5777768104..0d4b694582 100644 --- a/src/server/initial_setup.py +++ b/src/server/initial_setup.py @@ -74,7 +74,7 @@ def create_objects(): limbo_obj.id = 2 string = " ".join([ "Welcome to your new {wEvennia{n-based game. From here you are ready to begin development.", - "If you should need help or would like to participate in community discussions, visit http://evennia.com.", + "Visit http://evennia.com if you should need help or would like to participate in community discussions.", "If you are logged in as User #1 you can create a demo/tutorial area with '@batchcommand contrib.tutorial_world.build'.", "Log out and create a new non-admin account at the login screen to play the tutorial properly."]) string = _(string) diff --git a/src/utils/text2html.py b/src/utils/text2html.py index 559b8fe594..d7b175938a 100644 --- a/src/utils/text2html.py +++ b/src/utils/text2html.py @@ -37,7 +37,7 @@ class TextToHTMLparser(object): normalcode = '\033[0m' tabstop = 4 - re_string = re.compile(r'(?P[<&>])|(?P^[ \t]+)|(?P\r\n|\r|\n)|(?P(^|\s)((http|ftp)://.*?))(\s|$)', + re_string = re.compile(r'(?P[<&>])|(?P^[ \t]+)|(?P\r\n|\r|\n)',#|(?P(^|\s)((http|ftp)://.*?))(\s|$)', re.S|re.M|re.I) def re_color(self, text): @@ -79,7 +79,7 @@ class TextToHTMLparser(object): def convert_urls(self, text): "Replace urls (http://...) by valid HTML" regexp = r"((ftp|www|http)(\W+\S+[^).,:;?\]\}(\) \r\n$]+))" - return re.sub(regexp, r'\1', text) + return re.sub(regexp, r'\1 ', text) def do_sub(self, m): "Helper method to be passed to re.sub." @@ -88,23 +88,26 @@ class TextToHTMLparser(object): return cgi.escape(c['htmlchars']) if c['lineend']: return '
' + elif c['space'] == '\t': + return ' '*self.tabstop elif c['space']: t = m.group().replace('\t', ' '*self.tabstop) t = t.replace(' ', ' ') return t - elif c['space'] == '\t': - return ' '*self.tabstop - else: - url = m.group('protocol') - if url.startswith(' '): - prefix = ' ' - url = url[1:] - else: - prefix = '' - last = m.groups()[-1] - if last in ['\n', '\r', '\r\n']: - last = '
' - return '%s%s' % (prefix, url) + # else: + # return m.group('protocol') + ' ' + # url = m.group('protocol') + # prefix, postfix = '','' + # if url.startswith(' '): + # prefix = ' ' + # url = url[1:] + # if url.endswith(' '): + # postfix = ' ' + # url = url[:-1] + # last = m.groups()[-1] + # if last in ['\n', '\r', '\r\n']: + # last = '
' + # return '%s%s%s' % (prefix, url, postfix) def parse(self, text): """ @@ -124,7 +127,6 @@ class TextToHTMLparser(object): result = self.convert_linebreaks(result) result = self.remove_backspaces(result) result = self.convert_urls(result) - # clean out eventual ansi that was missed result = ansi.parse_ansi(result, strip_ansi=True)