Merge branch 'patch-1' of https://github.com/BlauFeuer/evennia into BlauFeuer-patch-1

This commit is contained in:
Griatch 2016-11-05 22:14:57 +01:00
commit 3de2e649a1
2 changed files with 4 additions and 3 deletions

View file

@ -21,7 +21,7 @@ LINKS_SUB = re.compile(r'\|lc(.*?)\|lt(.*?)\|le', re.DOTALL)
MXP = "\x5B"
MXP_TEMPSECURE = "\x1B[4z"
MXP_SEND = MXP_TEMPSECURE + \
"<SEND HREF='\\1'>" + \
"<SEND HREF=\"\\1\">" + \
"\\2" + \
MXP_TEMPSECURE + \
"</SEND>"
@ -38,6 +38,7 @@ def mxp_parse(text):
"""
text = text.replace("&", "&amp;") \
.replace('"', "&quot;") \
.replace("<", "&lt;") \
.replace(">", "&gt;")

View file

@ -234,7 +234,7 @@ class TextToHTMLparser(object):
def convert_links(self, text):
"""
Replaces links with HTML code.
Replaces MXP links with HTML code.
Args:
text (str): Text to process.
@ -243,7 +243,7 @@ class TextToHTMLparser(object):
text (str): Processed text.
"""
return self.re_mxplink.sub(r"""<a id='mxplink' href='#' onclick='Evennia.msg("text",["\1"],{}); return false;'>\2</a>""", text)
return self.re_mxplink.sub(r'''<a id="mxplink" href="#" onclick="Evennia.msg(&quot;text&quot;,[&quot;\1&quot;],{}); return false;">\2</a>''', text)
def do_sub(self, match):
"""