$dom = HTML_Parser::parse($html);
foreach ($dom->children as $node) {
if ($node instanceof HTML_Parser_Element) {
$this->_processNode($node, $html, $path, $getTranslation);
}
}
// Remove i18n attributes
if ($getTranslation) {
$dom->walk(
function ($node) {
if ($node instanceof HTML_Parser_Element && $node->hasAttribute('i18n')) {
$node->hasAttribute('i18n')->remove();
}
}
);
}
return $dom->render();
-
Notifications
You must be signed in to change notification settings - Fork 0
ideatic/html-parser
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Simple and forgiving HTML parser that tries to keep original input as much as possible
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published