-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOMDocument::loadHTML(): Tag article invalid in Entity #1
Comments
$dom = new domDocument; |
@$dom->loadHTML($url); |
why does this work? |
@ will disable error reporting |
hides errors and super not recommended |
In PHP the @ symbol ignores error. See https://www.php.net/manual/en/language.operators.errorcontrol.php |
$dom->loadHtml($id); |
HTML5 is not supported by libxml2, therefore any HTML5 tag will fail. $dom->loadHtml($id, LIBXML_NOERROR); |
Thanks, work for me! |
Encountering unexpected error while parsing HTML5 tags:
Here is the code I'm trying to minify, https://validator.w3.org says it's valid:
It seems to be a known problem: http://stackoverflow.com/questions/6090667/php-domdocument-errors-warnings-on-html5-tags
The text was updated successfully, but these errors were encountered: