Skip to content

Simple and forgiving HTML parser that tries to keep original input as much as possible

Notifications You must be signed in to change notification settings

ideatic/html-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

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

No packages published

Languages