import re


def cleantext(text):
    """
    Custom function to clean enriched text

    :param text(str): Enriched ytext from Ekstep Content.
    :returns: Cleaned text.
    """
    replace_char = [
        "[",
        "]",
        "u'",
        "None",
        "Thank you",
        "-",
        "(",
        ")",
        "#",
        "Done",
        ">",
        "<",
        "-",
        "|",
        "/",
        "\"",
        "Hint",
        "\n",
        "'"]
    for l in replace_char:
        text = text.replace(l, "")
    text = re.sub(' +', ' ', text)
    return text