import re


def normalize_md(text: str) -> str:
    """
    Applies a series of normalization steps to a text

    Parameters
    ----------
    text : str
        Text to manipulate

    Returns
    -------
    str
        The new text
    """
    # Replace \r\n with \n
    res = re.sub(r"(\r\n)", '\n', text)
    # Remove multiple lines
    res = re.sub(r"(\n{2,})", '\n', res)
    # Fix title =
    res = re.sub(r"(\n\n)=", '\n', res)
    # Fix title -
    res = re.sub(r"(\n\n)-", '\n', res)
    # Fix parameters
    res = re.sub(r"(^\*{2,})", '\n**', res)
    return res