Work with HTML (parsing processing) (tag)

WP_HTML_Processor{}

Class used for parsing and modifying an HTML document.

wp_html_split()

Parses the given text (in the form of HTML code) into HTML tags and comments, returning an array of values: tags and their text.