parameters: (elements)
return_statement: return errors
docstring: Recursively validates elements for being in the allow list
docstring_summary: Recursively validates elements for being in the allow list
docstring_tokens: Recursively validates elements for being in the allow list
function: def validate_elements_tags(elements):
      """Recursively validates elements for being in the allow list"""
      errors = None
      for element in elements:
          if element.tag not in allowed_html_tags:
              error = ("ERROR: Element <{0}> is not allowed.\n").format(
                  element.tag)
              errors = (errors or '') + error
          rec_errors = validate_elements_tags(list(element))
          if rec_errors is not None:
              errors = (errors or '') + rec_errors
      return errors
function_tokens: def validate_elements_tags ( elements ) : errors = None for element in elements : if element . tag not in allowed_html_tags : error = ( "ERROR: Element <{0}> is not allowed.\n" ) . format ( element . tag ) errors = ( errors or '' ) + error rec_errors = validate_elements_tags ( list ( element ) ) if rec_errors is not None : errors = ( errors or '' ) + rec_errors return errors