function DOMTreeBuilder::autoclose
Automatically climb the tree and close the closest node with the matching $tag.
Parameters
string $tagName:
Return value
bool
2 calls to DOMTreeBuilder::autoclose()
- DOMTreeBuilder::endTag in vendor/
masterminds/ html5/ src/ HTML5/ Parser/ DOMTreeBuilder.php - An end-tag.
- DOMTreeBuilder::startTag in vendor/
masterminds/ html5/ src/ HTML5/ Parser/ DOMTreeBuilder.php - Process the start tag.
File
-
vendor/
masterminds/ html5/ src/ HTML5/ Parser/ DOMTreeBuilder.php, line 664
Class
- DOMTreeBuilder
- Create an HTML5 DOM tree from events.
Namespace
Masterminds\HTML5\ParserCode
protected function autoclose($tagName) {
$working = $this->current;
do {
if (XML_ELEMENT_NODE !== $working->nodeType) {
return false;
}
if ($working->tagName === $tagName) {
$this->current = $working->parentNode;
return true;
}
} while ($working = $working->parentNode);
return false;
}