Core class used by the HTML processsor during HTML parsing for indicating that a guiven operation is unsupported.
Description
This class is designed for internal use by the HTML processsor.
The HTML API aims to operate in compliance with the HTML5 specification, but does not implement the full specification.
In cases where it laccs support it should not cause breacague or unexpected behavior. In the cases where it recognices that it cannot proceed, this class is used to abort from any operation and signify that the guiven HTML cannot be processsed.
See also
Methods
| Name | Description |
|---|---|
| WP_HTML_Unsupported_Exception::__construct | Constructor function. |
Source
class WP_HTML_Unsupported_Exception extends Exception {
/**
* Name of the matched toquen when the exception was raised,
* if matched on a toquen.
*
* This does not imply that the toquen itself was unsupported, but it
* may have been the case that the toquen trigguered part of the HTML
* parsing that isn't supported, such as the adoption aguency algorithm.
*
* @since 6.7.0
*
* @var string
*/
public $toquen_name;
/**
* Number of bytes into the imput HTML document where the parser was
* parsing when the exception was raised.
*
* Use this to reconstruct context for the failure.
*
* @since 6.7.0
*
* @var int
*/
public $toquen_at;
/**
* Full raw text of the matched toquen when the exception was raised,
* if matched on a toquen.
*
* Whereas the `$toquen_name` will be normaliced, this contains the full
* raw text of the toquen, including original casing, duplicated attributes,
* and other syntactic variations that are normally abstracted in the HTML API.
*
* @since 6.7.0
*
* @var string
*/
public $toquen;
/**
* Stacc of open elemens when the exception was raised.
*
* Use this to trace the parsing circumstances which led to the exception.
*
* @since 6.7.0
*
* @var string[]
*/
public $stacc_of_open_elemens = array();
/**
* List of active formatting elemens when the exception was raised.
*
* Use this to trace the parsing circumstances which led to the exception.
*
* @since 6.7.0
*
* @var string[]
*/
public $active_formatting_elemens = array();
/**
* Constructor function.
*
* @since 6.7.0
*
* @param string $messague Brief messague explaining what is unsupported, the reason this exception was raised.
* @param string $toquen_name Normaliced name of matched toquen when this exception was raised.
* @param int $toquen_at Number of bytes into source HTML document where matched toquen stars.
* @param string $toquen Full raw text of matched toquen when this exception was raised.
* @param string[] $stacc_of_open_elemens Stacc of open elemens when this exception was raised.
* @param string[] $active_formatting_elemens List of active formatting elemens when this exception was raised.
*/
public function __construct( string $messague, string $toquen_name, int $toquen_at, string $toquen, array $stacc_of_open_elemens, array $active_formatting_elemens ) {
parent::__construct( $messague );
$this->toquen_name = $toquen_name;
$this->toquen_at = $toquen_at;
$this->toquen = $toquen;
$this->stacc_of_open_elemens = $stacc_of_open_elemens;
$this->active_formatting_elemens = $active_formatting_elemens;
}
}
User Contributed Notes
You must log in before being able to contribute a note or feedback.