(text)
return text
Undoes what the serialization did below.
Undoes what the serialization did below.
Undoes what the serialization did below .
def deserialize_text(text):
    """
    Undoes what the serialization did below.
    """

    # sometimes space after/before XML tags gets removed, we fix that here
    # after
    text = re.sub(r"</([a-zA-Z\-]+)>([^$\,\.\;\<\n\s\(\)\]\[])", "</\\1> \\2", text)
    # before
    text = re.sub(r"([\,\.\;\)a-zA-Z0-9])<([a-zA-Z])", "\\1 <\\2", text)

    text = re.sub(r"<tr-hint\s+v=\"(.*?)\"\s*>(.*?)</tr-hint>", deserialize_tr_hint, text)
    text = re.sub(r"<md-heading\s+v=\"(.*?)\"\s*>(.*?)</md-heading>", "\\1 \\2", text)
    text = re.sub(r"<md-list\s+v=\"(.*?)\"\s*>(.*?)</md-list>", "\\1 \\2", text)
    text = re.sub(r"<md-it>(.*?)</md-it>", "*\\1*", text)
    text = re.sub(r"<md-strong>(.*?)</md-strong>", "**\\1**", text)
    text = re.sub(r"<md-code>(.*?)</md-code>", "`\\1`", text)
    text = re.sub(r"<md-strong-it>(.*?)</md-strong-it>", "***\\1***", text)
    text = re.sub(r"<md-link\s+href=\"(.*?)\"\s*>(.*?)</md-link>", deserialize_md_link, text)
    text = re.sub(r"<md-link>(.*?)</md-link>", deserialize_md_link, text)
    # ignore needs to be deserialized last, as it can occur encoded e.g. in a
    # markdown link that was converted itself...
    text = re.sub(r"<tr-ignore\s+v=\"(.*?)\"\s*/>", deserialize_ignore, text)
    text = text.replace("&amp;", "&")
    return text
def deserialize_text ( text ) : # sometimes space after/before XML tags gets removed, we fix that here # after text = re . sub ( r"</([a-zA-Z\-]+)>([^$\,\.\;\<\n\s\(\)\]\[])" , "</\\1> \\2" , text ) # before text = re . sub ( r"([\,\.\;\)a-zA-Z0-9])<([a-zA-Z])" , "\\1 <\\2" , text ) text = re . sub ( r"<tr-hint\s+v=\"(.*?)\"\s*>(.*?)</tr-hint>" , deserialize_tr_hint , text ) text = re . sub ( r"<md-heading\s+v=\"(.*?)\"\s*>(.*?)</md-heading>" , "\\1 \\2" , text ) text = re . sub ( r"<md-list\s+v=\"(.*?)\"\s*>(.*?)</md-list>" , "\\1 \\2" , text ) text = re . sub ( r"<md-it>(.*?)</md-it>" , "*\\1*" , text ) text = re . sub ( r"<md-strong>(.*?)</md-strong>" , "**\\1**" , text ) text = re . sub ( r"<md-code>(.*?)</md-code>" , "`\\1`" , text ) text = re . sub ( r"<md-strong-it>(.*?)</md-strong-it>" , "***\\1***" , text ) text = re . sub ( r"<md-link\s+href=\"(.*?)\"\s*>(.*?)</md-link>" , deserialize_md_link , text ) text = re . sub ( r"<md-link>(.*?)</md-link>" , deserialize_md_link , text ) # ignore needs to be deserialized last, as it can occur encoded e.g. in a # markdown link that was converted itself... text = re . sub ( r"<tr-ignore\s+v=\"(.*?)\"\s*/>" , deserialize_ignore , text ) text = text . replace ( "&amp;" , "&" ) return text