mirror of
https://github.com/evennia/evennia.git
synced 2026-04-05 23:47:16 +02:00
Merge branch 'patch-1' of https://github.com/BlauFeuer/evennia into BlauFeuer-patch-1
This commit is contained in:
commit
3de2e649a1
2 changed files with 4 additions and 3 deletions
|
|
@ -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("&", "&") \
|
||||
.replace('"', """) \
|
||||
.replace("<", "<") \
|
||||
.replace(">", ">")
|
||||
|
||||
|
|
|
|||
|
|
@ -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("text",["\1"],{}); return false;">\2</a>''', text)
|
||||
|
||||
def do_sub(self, match):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue