Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
0.00% covered (danger)
0.00%
0 / 1
25.00% covered (danger)
25.00%
1 / 4
CRAP
97.96% covered (success)
97.96%
480 / 490
InBody
0.00% covered (danger)
0.00%
0 / 1
25.00% covered (danger)
25.00%
1 / 4
229
97.96% covered (success)
97.96%
479 / 489
 characters
0.00% covered (danger)
0.00%
0 / 1
3.01
88.89% covered (warning)
88.89%
8 / 9
 startTag
0.00% covered (danger)
0.00%
0 / 1
152
99.38% covered (success)
99.38%
319 / 321
 endTag
0.00% covered (danger)
0.00%
0 / 1
72
95.42% covered (success)
95.42%
146 / 153
 endDocument
100.00% covered (success)
100.00%
1 / 1
2
100.00% covered (success)
100.00%
6 / 6
<?php
namespace Wikimedia\RemexHtml\TreeBuilder;
use Wikimedia\RemexHtml\HTMLData;
use Wikimedia\RemexHtml\Tokenizer\Attributes;
use Wikimedia\RemexHtml\Tokenizer\PlainAttributes;
use Wikimedia\RemexHtml\Tokenizer\Tokenizer;
/**
 * The "in body" insertion mode.
 */
class InBody extends InsertionMode {
    /**
     * The tag names h1-h6, which are referred to at a couple of points.
     */
    private static $headingNames = [ 'h1' => true, 'h2' => true, 'h3' => true, 'h4' => true,
        'h5' => true, 'h6' => true ];
    /**
     * The tag names which can be closed by </body> or </html> without causing
     * an error.
     */
    private static $implicitClose = [
        'dd' => true,
        'dt' => true,
        'li' => true,
        'optgroup' => true,
        'option' => true,
        'p' => true,
        'rb' => true,
        'rp' => true,
        'rt' => true,
        'rtc' => true,
        'tbody' => true,
        'td' => true,
        'tfoot' => true,
        'th' => true,
        'thead' => true,
        'tr' => true,
        'body' => true,
        'html' => true,
    ];
    public function characters( $text, $start, $length, $sourceStart, $sourceLength ) {
        $handleNonNull = function ( $text, $start, $length, $sourceStart, $sourceLength ) {
            if ( strspn( $text, "\t\n\f\r ", $start, $length ) !== $length ) {
                $this->builder->framesetOK = false;
            }