Indicates the kind of matched token, if any.
Description
This differs from get_token_name()
in that it always returns a static string indicating the type, whereas get_token_name()
may return values derived from the token itself, such as a tag name or processing instruction tag.
Possible values:
#tag
when matched on a tag.#text
when matched on a text node.#cdata-section
when matched on a CDATA node.#comment
when matched on a comment.#doctype
when matched on a DOCTYPE declaration.#presumptuous-tag
when matched on an empty tag closer.#funky-comment
when matched on a funky comment.
Source
if ( is_string( $charset ) && 'tentative' === $this->state->encoding_confidence ) {
$this->bail( 'Cannot yet process META tags with charset to determine encoding.' );
}
/*
* > - Otherwise, if the element has an http-equiv attribute whose value is
* > an ASCII case-insensitive match for the string "Content-Type", and
* > the element has a content attribute, and applying the algorithm for
* > extracting a character encoding from a meta element to that attribute's
* > value returns an encoding, and the confidence is currently tentative,
* > then change the encoding to the extracted encoding.
*/
$http_equiv = $this->get_attribute( 'http-equiv' );
$content = $this->get_attribute( 'content' );
if (
is_string( $http_equiv ) &&
is_string( $content ) &&
0 === strcasecmp( $http_equiv, 'Content-Type' ) &&
'tentative' === $this->state->encoding_confidence
) {
$this->bail( 'Cannot yet process META tags with http-equiv Content-Type to determine encoding.' );
}
Changelog
Version | Description |
---|---|
6.6.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.