// SPECIAL TAG HANDLING:
// Spec says do this, and "don't ask."
// find the spec where this is defined... looks problematic
if ('image' ===
$name && !
($this->insertMode ===
static::IM_IN_SVG ||
$this->insertMode ===
static::IM_IN_MATHML
)) { $name = 'img';
} // Autoclose p tags where appropriate.
if ($this->insertMode >=
static::IM_IN_BODY && Elements::
isA($name, Elements::AUTOCLOSE_P
)) { $this->
autoclose('p'
);
} // Set insert mode:
switch ($name) { case 'html':
$this->insertMode =
static::IM_BEFORE_HEAD;
break;
case 'head':
if ($this->insertMode >
static::IM_BEFORE_HEAD
) { $this->
parseError('Unexpected head tag outside of head context.'
);
} else {