ideatic/html-parser

description

Installs: 3 028

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

pkg:composer/ideatic/html-parser

dev-main 2025-05-06 16:56 UTC

This package is not auto-updated.

Last update: 2025-10-07 19:21:17 UTC


README

  $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();