def METHOD_NAME(txt):
    """Slugify function."""
    output = txt.lower()
    output = re.sub(r'\]\([^)]*\)', ']', output)  # remove the content of parenthesis if reference
    output = re.sub(r'<[^>]+>', '', output)
    output = output.replace('+', 'p')
    output = re.sub(r"[\(\):`'=]", '', output)
    output = re.sub(r'\\_', '_', output)
    output = re.sub(r'[\W-]+', '-', output)
    output = re.sub(r'^-*', '', output)
    output = re.sub(r'-*$', '', output)
    return output.strip(' ').strip('-')