foreach ($config->
getAttributeSanitizers() as $attributeSanitizer) { foreach ($attributeSanitizer->
getSupportedElements() ??
['*'
] as $element) { foreach ($attributeSanitizer->
getSupportedAttributes() ??
['*'
] as $attribute) { $this->attributeSanitizers
[$element][$attribute][] =
$attributeSanitizer;
} } } } public function visit(\DOMDocumentFragment
$domNode): ?NodeInterface
{ $cursor =
new Cursor(new DocumentNode());
$this->
visitChildren($domNode,
$cursor);
return $cursor->node;
} private function visitNode(\DOMNode
$domNode, Cursor
$cursor): void
{ $nodeName = StringSanitizer::
htmlLower($domNode->nodeName
);
// Element should be dropped, including its children
if (!\
array_key_exists($nodeName,
$this->elementsConfig
)) {