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

Tag names with strange capitalisation #63

zhaofengli opened this Issue Nov 23, 2014 · 0 comments


None yet
1 participant

zhaofengli commented Nov 23, 2014

The parser fails when it encounters a tag name with strange capitalisation (e.g. <Title>, <titlE>, etc). For example, this script

require_once __DIR__ . "/vendor/autoload.php";
$html = <<< 'HERE'
<!doctype html>
        <Title>Hello, world!</Title>
$parser = new Masterminds\HTML5;
$dom = $parser->loadHTML( $html );

echo "== HTML5 rendering ==\n";
echo $parser->saveHTML( $dom );

echo "== XPath queries ==\n";
$xpath = new DOMXPath( $dom );
$xpath->registerNamespace( "x", "" );
echo "=== Value of <title> ===\n";
echo $xpath->query( "//x:title" )->item( 0 )->nodeValue;


== HTML5 rendering ==
<!DOCTYPE html>
    <title>Hello, world!&lt;/Title&gt;
== XPath queries ==
=== Value of <title> ===
Hello, world!</Title>

The HTML supplied is valid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment