| @@ 2354-2371 (lines=18) @@ | ||
| 2351 | break; |
|
| 2352 | ||
| 2353 | /* A start tag token whose tag name is "plaintext" */ |
|
| 2354 | case 'plaintext': |
|
| 2355 | /* If the stack of open elements has a p element in scope, |
|
| 2356 | then act as if an end tag with the tag name p had been |
|
| 2357 | seen. */ |
|
| 2358 | if ($this->elementInScope('p')) { |
|
| 2359 | $this->emitToken( |
|
| 2360 | array( |
|
| 2361 | 'name' => 'p', |
|
| 2362 | 'type' => HTML5::ENDTAG |
|
| 2363 | ) |
|
| 2364 | ); |
|
| 2365 | } |
|
| 2366 | ||
| 2367 | /* Insert an HTML element for the token. */ |
|
| 2368 | $this->insertElement($token); |
|
| 2369 | ||
| 2370 | return HTML5::PLAINTEXT; |
|
| 2371 | break; |
|
| 2372 | ||
| 2373 | /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", |
|
| 2374 | "h5", "h6" */ |
|
| @@ 2522-2539 (lines=18) @@ | ||
| 2519 | break; |
|
| 2520 | ||
| 2521 | /* A start tag whose tag name is "table" */ |
|
| 2522 | case 'table': |
|
| 2523 | /* If the stack of open elements has a p element in scope, |
|
| 2524 | then act as if an end tag with the tag name p had been seen. */ |
|
| 2525 | if ($this->elementInScope('p')) { |
|
| 2526 | $this->emitToken( |
|
| 2527 | array( |
|
| 2528 | 'name' => 'p', |
|
| 2529 | 'type' => HTML5::ENDTAG |
|
| 2530 | ) |
|
| 2531 | ); |
|
| 2532 | } |
|
| 2533 | ||
| 2534 | /* Insert an HTML element for the token. */ |
|
| 2535 | $this->insertElement($token); |
|
| 2536 | ||
| 2537 | /* Change the insertion mode to "in table". */ |
|
| 2538 | $this->mode = self::IN_TABLE; |
|
| 2539 | break; |
|
| 2540 | ||
| 2541 | /* A start tag whose tag name is one of: "area", "basefont", |
|
| 2542 | "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ |
|
| @@ 2563-2580 (lines=18) @@ | ||
| 2560 | break; |
|
| 2561 | ||
| 2562 | /* A start tag whose tag name is "hr" */ |
|
| 2563 | case 'hr': |
|
| 2564 | /* If the stack of open elements has a p element in scope, |
|
| 2565 | then act as if an end tag with the tag name p had been seen. */ |
|
| 2566 | if ($this->elementInScope('p')) { |
|
| 2567 | $this->emitToken( |
|
| 2568 | array( |
|
| 2569 | 'name' => 'p', |
|
| 2570 | 'type' => HTML5::ENDTAG |
|
| 2571 | ) |
|
| 2572 | ); |
|
| 2573 | } |
|
| 2574 | ||
| 2575 | /* Insert an HTML element for the token. */ |
|
| 2576 | $this->insertElement($token); |
|
| 2577 | ||
| 2578 | /* Immediately pop the current node off the stack of open elements. */ |
|
| 2579 | array_pop($this->stack); |
|
| 2580 | break; |
|
| 2581 | ||
| 2582 | /* A start tag whose tag name is "image" */ |
|
| 2583 | case 'image': |
|