| @@ 2362-2379 (lines=18) @@ | ||
| 2359 | break; |
|
| 2360 | ||
| 2361 | /* A start tag token whose tag name is "plaintext" */ |
|
| 2362 | case 'plaintext': |
|
| 2363 | /* If the stack of open elements has a p element in scope, |
|
| 2364 | then act as if an end tag with the tag name p had been |
|
| 2365 | seen. */ |
|
| 2366 | if ($this->elementInScope('p')) { |
|
| 2367 | $this->emitToken( |
|
| 2368 | array( |
|
| 2369 | 'name' => 'p', |
|
| 2370 | 'type' => HTML5::ENDTAG |
|
| 2371 | ) |
|
| 2372 | ); |
|
| 2373 | } |
|
| 2374 | ||
| 2375 | /* Insert an HTML element for the token. */ |
|
| 2376 | $this->insertElement($token); |
|
| 2377 | ||
| 2378 | return HTML5::PLAINTEXT; |
|
| 2379 | break; |
|
| 2380 | ||
| 2381 | /* A start tag whose tag name is one of: "h1", "h2", "h3", "h4", |
|
| 2382 | "h5", "h6" */ |
|
| @@ 2530-2547 (lines=18) @@ | ||
| 2527 | break; |
|
| 2528 | ||
| 2529 | /* A start tag whose tag name is "table" */ |
|
| 2530 | case 'table': |
|
| 2531 | /* If the stack of open elements has a p element in scope, |
|
| 2532 | then act as if an end tag with the tag name p had been seen. */ |
|
| 2533 | if ($this->elementInScope('p')) { |
|
| 2534 | $this->emitToken( |
|
| 2535 | array( |
|
| 2536 | 'name' => 'p', |
|
| 2537 | 'type' => HTML5::ENDTAG |
|
| 2538 | ) |
|
| 2539 | ); |
|
| 2540 | } |
|
| 2541 | ||
| 2542 | /* Insert an HTML element for the token. */ |
|
| 2543 | $this->insertElement($token); |
|
| 2544 | ||
| 2545 | /* Change the insertion mode to "in table". */ |
|
| 2546 | $this->mode = self::IN_TABLE; |
|
| 2547 | break; |
|
| 2548 | ||
| 2549 | /* A start tag whose tag name is one of: "area", "basefont", |
|
| 2550 | "bgsound", "br", "embed", "img", "param", "spacer", "wbr" */ |
|
| @@ 2571-2588 (lines=18) @@ | ||
| 2568 | break; |
|
| 2569 | ||
| 2570 | /* A start tag whose tag name is "hr" */ |
|
| 2571 | case 'hr': |
|
| 2572 | /* If the stack of open elements has a p element in scope, |
|
| 2573 | then act as if an end tag with the tag name p had been seen. */ |
|
| 2574 | if ($this->elementInScope('p')) { |
|
| 2575 | $this->emitToken( |
|
| 2576 | array( |
|
| 2577 | 'name' => 'p', |
|
| 2578 | 'type' => HTML5::ENDTAG |
|
| 2579 | ) |
|
| 2580 | ); |
|
| 2581 | } |
|
| 2582 | ||
| 2583 | /* Insert an HTML element for the token. */ |
|
| 2584 | $this->insertElement($token); |
|
| 2585 | ||
| 2586 | /* Immediately pop the current node off the stack of open elements. */ |
|
| 2587 | array_pop($this->stack); |
|
| 2588 | break; |
|
| 2589 | ||
| 2590 | /* A start tag whose tag name is "image" */ |
|
| 2591 | case 'image': |
|