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