def subtree_has_tag(block, tagname):
    """
    Check if the doctree node contains a particular tag in its subtree.

    Args:
      block: A block that has to be checked
      tagname: The searched tag

    Returns: True if the subtree contains a node with the tagname or False otherwise.

    """

    for node in block.traverse(include_self=False):
        if node.tagname.strip() == tagname:
            return True

    return False