Parses HTML into a tree of tags.
package | XenForo_Html |
---|
__construct(string $html)
Sets up HTML.
string
HTML to parse
appendText(string | false $text)
Text is cleaned of HTML entities first.
string
false
Text to append; false is ignored
decodeEntities(string $string) : string
Note that non-breaking spaces are treated as normal spaces.
string
string
Decoded stringparse() : \XenForo_Html_Tag
\XenForo_Html_Tag
The root tag of the tree. This tag isn't really in the tree, so traversal should start with its children.parseCss(string $css) : array
string
array
Key-value rule pairspeak() : false | string
false
string
False if past the end; character otherwiseprintTags(\XenForo_Html_Tag $tag, string $prefix)
pushTagClose(string $tagName)
string
pushTagOpen(string $tagName, array $attributes) : \XenForo_Html_Tag
string
array
Key-value attributes; cleaned of HTML entities within function
\XenForo_Html_Tag
Child tag that was addedreadUntilCharacters(string $characters) : false | string
string
List of characters
false
string
False if the none of the characters are found; otherwise, text to first character foundreadUntilEnd() : false | string
false
string
False if at the end; otherwise, text until endreadUntilString(string $string) : false | string
string
false
string
False if the string is not found; otherwise, text to stringskipWhiteSpace()
stateAttribute(array $attributes) : boolean
array
Existing attribute list. New attributes are pushed onto this.
boolean
If false is returned, the containing tag is considered invalid and treated as textstateTag() : boolean
The opening < has been found and passed.
boolean
True if tag was parsed; if false, the tag is treated as plain textstep() : string
string
stepBack()
$_currentTag : \XenForo_Html_Tag
$_html : string
$_length : integer
$_position : integer
$_rootTag : \XenForo_Html_Tag