def METHOD_NAME(self, line: str) -> tuple[int, str]:
    """
    Return level, name if line is a hash section line.
    else return None, None.
    """
    m = self.md_hash_pattern.match(line)
    if m:
        level = len(m.group(1))
        name = m.group(2).strip()
        if name:
            return level, name
    return None, None