diff options
-rw-r--r-- | src/HTML5/Parser/Tokenizer.php | 8 | ||||
-rw-r--r-- | test/HTML5/Parser/TokenizerTest.php | 4 |
2 files changed, 7 insertions, 5 deletions
diff --git a/src/HTML5/Parser/Tokenizer.php b/src/HTML5/Parser/Tokenizer.php index d98f619..381e9e6 100644 --- a/src/HTML5/Parser/Tokenizer.php +++ b/src/HTML5/Parser/Tokenizer.php @@ -405,8 +405,8 @@ class Tokenizer { //if (strspn($name, '\'\"')) { $this->parseError("Unexpected characters in attribute name: %s", $name); } - // Whitespace not allowed between name and =. - //$this->scanner->whitespace(); + // 8.1.2.3 + $this->scanner->whitespace(); $val = $this->attributeValue(); //return array($name, $val); @@ -423,8 +423,8 @@ class Tokenizer { return NULL; } $this->scanner->next(); - // Whitespace is significant - //$this->scanner->whitespace(); + // 8.1.2.3 + $this->scanner->whitespace(); $tok = $this->scanner->current(); switch ($tok) { diff --git a/test/HTML5/Parser/TokenizerTest.php b/test/HTML5/Parser/TokenizerTest.php index eb94035..aff819e 100644 --- a/test/HTML5/Parser/TokenizerTest.php +++ b/test/HTML5/Parser/TokenizerTest.php @@ -336,6 +336,9 @@ class TokenizerTest extends \HTML5\Tests\TestCase { '<doe a deer>' => array('doe', array('a' => NULL, 'deer' => NULL), FALSE), '<foo bar=baz>' => array('foo', array('bar' => 'baz'), FALSE), + // Updated for 8.1.2.3 + '<foo bar = "baz" >' => array('foo', array('bar' => 'baz'), FALSE), + // The spec allows an unquoted value '/'. This will not be a closing // tag. '<foo bar=/>' => array('foo', array('bar' => '/'), FALSE), @@ -374,7 +377,6 @@ class TokenizerTest extends \HTML5\Tests\TestCase { $reallyBad = array( '<foo ="bar">' => array('foo', array('=' => NULL, '"bar"' => NULL), FALSE), '<foo////>' => array('foo', array(), TRUE), - '<foo bar = "baz" >' => array('foo', array('bar' => NULL, '=' => NULL, '"baz"' => NULL), FALSE), ); foreach ($reallyBad as $test => $expects) { $events = $this->parse($test); |