import re
import string


def _sanitize_name(name):
    """Sanitize content of an H2 header to be used as a filename
    """
    # replace all non-aplhanumeric with a dash
    sanitized = re.sub('[^0-9a-zA-Z]+', '-', name.lower())

    # argo does not allow names to start with a digit when using dependencies
    if sanitized[0] in string.digits:
        sanitized = 'section-' + sanitized

    return sanitized