@@ 321-335 (lines=15) @@ | ||
318 | Switch to the close tag open state. */ |
|
319 | $this->state = 'closeTagOpen'; |
|
320 | ||
321 | } elseif(preg_match('/^[A-Za-z]$/', $char)) { |
|
322 | /* U+0041 LATIN LETTER A through to U+005A LATIN LETTER Z |
|
323 | Create a new start tag token, set its tag name to the lowercase |
|
324 | version of the input character (add 0x0020 to the character's code |
|
325 | point), then switch to the tag name state. (Don't emit the token |
|
326 | yet; further details will be filled in before it is emitted.) */ |
|
327 | $this->token = array( |
|
328 | 'name' => strtolower($char), |
|
329 | 'type' => self::STARTTAG, |
|
330 | 'attr' => array() |
|
331 | ); |
|
332 | ||
333 | $this->state = 'tagName'; |
|
334 | ||
335 | } elseif($char === '>') { |
|
336 | /* U+003E GREATER-THAN SIGN (>) |
|
337 | Parse error. Emit a U+003C LESS-THAN SIGN character token and a |
|
338 | U+003E GREATER-THAN SIGN character token. Switch to the data state. */ |
|
@@ 959-968 (lines=10) @@ | ||
956 | if(preg_match('/^[\t\n\x0b\x0c ]$/', $char)) { |
|
957 | // Stay in the before DOCTYPE name state. |
|
958 | ||
959 | } elseif(preg_match('/^[a-z]$/', $char)) { |
|
960 | $this->token = array( |
|
961 | 'name' => strtoupper($char), |
|
962 | 'type' => self::DOCTYPE, |
|
963 | 'error' => true |
|
964 | ); |
|
965 | ||
966 | $this->state = 'doctypeName'; |
|
967 | ||
968 | } elseif($char === '>') { |
|
969 | $this->emitToken(array( |
|
970 | 'name' => null, |
|
971 | 'type' => self::DOCTYPE, |