RemexHtml
Fast HTML 5 parser
|
A formatter suitable for pre-sanitized input with ignoreEntities enabled in the Tokenizer. More...
Public Member Functions | |||||||||||||
__construct ( $options=[]) | |||||||||||||
startDocument ( $fragmentNamespace, $fragmentName) | |||||||||||||
Get a string which starts the document.
| |||||||||||||
doctype ( $name, $public, $system) | |||||||||||||
Encode a doctype.This event occurs when the source document has a doctype, it can return an empty string if the formatter wants to use its own doctype.
| |||||||||||||
characters (SerializerNode $parent, $text, $start, $length) | |||||||||||||
Encode the given character substring.
| |||||||||||||
element (SerializerNode $parent, SerializerNode $node, $contents) | |||||||||||||
Encode the given element.
| |||||||||||||
comment (SerializerNode $parent, $text) | |||||||||||||
Encode a comment.
| |||||||||||||
A formatter suitable for pre-sanitized input with ignoreEntities enabled in the Tokenizer.
Wikimedia\RemexHtml\Serializer\FastFormatter::characters | ( | SerializerNode | $parent, |
$text, | |||
$start, | |||
$length ) |
Encode the given character substring.
SerializerNode | $parent | The parent of the text node (at creation time) |
string | $text | |
int | $start | The offset within $text |
int | $length | The number of bytes within $text |
Implements Wikimedia\RemexHtml\Serializer\Formatter.
Wikimedia\RemexHtml\Serializer\FastFormatter::comment | ( | SerializerNode | $parent, |
$text ) |
Encode a comment.
SerializerNode | $parent | The parent of the node (at creation time) |
string | $text | The inner text of the comment |
Implements Wikimedia\RemexHtml\Serializer\Formatter.
Wikimedia\RemexHtml\Serializer\FastFormatter::doctype | ( | $name, | |
$public, | |||
$system ) |
Encode a doctype.This event occurs when the source document has a doctype, it can return an empty string if the formatter wants to use its own doctype.
string | $name | The doctype name, usually "html" |
string | $public | The PUBLIC identifier |
string | $system | The SYSTEM identifier |
Implements Wikimedia\RemexHtml\Serializer\Formatter.
Wikimedia\RemexHtml\Serializer\FastFormatter::element | ( | SerializerNode | $parent, |
SerializerNode | $node, | ||
$contents ) |
Encode the given element.
SerializerNode | $parent | The parent of the node (when it is closed) |
SerializerNode | $node | The element to encode |
string | null | $contents | The previously-encoded contents, or null for a void element. Void elements can be serialized as self-closing tags. |
Implements Wikimedia\RemexHtml\Serializer\Formatter.
Wikimedia\RemexHtml\Serializer\FastFormatter::startDocument | ( | $fragmentNamespace, | |
$fragmentName ) |
Get a string which starts the document.
string | null | $fragmentNamespace | |
string | null | $fragmentName |
Implements Wikimedia\RemexHtml\Serializer\Formatter.