(?P.*?)
)"
+ PRE_RE = r"(?P(?P.*?)
)"
+ MENTION_RE = r"(?P\d+?)\">(?P.*?) )"
+ URL_RE = r"(?P.*?)\">(?P.*?) )"
+
+ HTML_RE = re.compile("|".join([BOLD_RE, STRONG_RE, ITALIC_RE, EMPATHIZE_RE, CODE_RE, PRE_RE, MENTION_RE, URL_RE]))
+
+ @classmethod
+ def add_surrogates(cls, text):
+ return cls.SMP_RE.sub(
+ lambda match: # Split SMP in two surrogates
+ "".join(chr(i) for i in unpack("