'Helper method to be passed to re.sub,
replaces MXP links with HTML code.
Args:
text (str): Text to process.
Returns:
text (str): Processed text.'

def sub_mxp_links(self, match):

    (cmd, text) = [grp.replace('"', '\\&quot;') for grp in match.groups()]
    val = '<a    id="mxplink"    href="#"    onclick="Evennia.msg(&quot;text&quot;,[&quot;{cmd}&quot;],{{}});return    false;">{text}</a>'.format(cmd=cmd, text=text)
    return val
