RemexHtml
Fast HTML 5 parser
|
A formatter which produces a serialization extremely similar to the Html5Depurate service, which uses the validator.nu library for tree construction. More...
Public Member Functions | |
__construct ( $options=[]) | |
Constructor. | |
element (SerializerNode $parent, SerializerNode $node, $contents) | |
Encode the given element. | |
Public Member Functions inherited from Wikimedia\RemexHtml\Serializer\HtmlFormatter | |
startDocument ( $fragmentNamespace, $fragmentName) | |
Get a string which starts the document. | |
characters (SerializerNode $parent, $text, $start, $length) | |
Encode the given character substring. | |
comment (SerializerNode $parent, $text) | |
Encode a comment. | |
doctype ( $name, $public, $system) | |
Encode a doctype. | |
string | formatDOMElement ( $node, $contents) |
Public Member Functions inherited from Wikimedia\RemexHtml\DOM\DOMFormatter | |
string | formatDOMNode (DOMNode $node) |
Recursively format a DOMNode. | |
formatDOMElement (DOMElement $element, $contents) | |
Non-recursively format a DOMElement. | |
Additional Inherited Members | |
Protected Attributes inherited from Wikimedia\RemexHtml\Serializer\HtmlFormatter | |
array< string, bool > | $voidElements |
The elements for which a closing tag is omitted. | |
array< string, bool > | $prefixLfElements |
The elements which need a leading newline in their contents to be duplicated, since the parser strips a leading newline. | |
array< string, bool > | $rawTextElements |
The elements which have unescaped contents. | |
array< string, string > | $attributeEscapes |
The escape table for attribute values. | |
array< string, string > | $textEscapes |
The escape table for text nodes. | |
array< string, bool > | $unqualifiedNamespaces |
Attribute namespaces which have unqualified local names. | |
$useSourceDoctype | |
$reverseCoercion | |
A formatter which produces a serialization extremely similar to the Html5Depurate service, which uses the validator.nu library for tree construction.
For use in comparative testing.
Wikimedia\RemexHtml\Serializer\DepurateFormatter::__construct | ( | $options = [] | ) |
Constructor.
array | $options | An associative array of options:
|
Reimplemented from Wikimedia\RemexHtml\Serializer\HtmlFormatter.
Wikimedia\RemexHtml\Serializer\DepurateFormatter::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. |
Reimplemented from Wikimedia\RemexHtml\Serializer\HtmlFormatter.