class utils implements utils_interface
Text manipulation utilities
Methods
string |
clean_formatting(string $xml)
Replace BBCodes and other formatting elements with whitespace |
|
string |
generate_quote(string $text, array $attributes = array())
Create a quote block for given text |
|
string[] |
get_outermost_quote_authors(string $xml)
Get a list of quote authors, limited to the outermost quotes |
|
string |
remove_bbcode(string $xml, string $bbcode_name, integer $depth)
Remove given BBCode and its content, at given nesting depth |
|
string |
unparse(string $xml)
Return a parsed text to its original form |
|
bool |
is_empty(string $text)
Return whether or not a parsed text represent an empty text. |
Details
at line 29
public string
clean_formatting(string $xml)
Replace BBCodes and other formatting elements with whitespace
NOTE: preserves smilies as text
at line 63
public string
generate_quote(string $text, array $attributes = array())
Create a quote block for given text
Possible attributes: - author: author's name (usually a username) - postid: postid of the post being quoted - userid: userid of the user being quoted - time: timestamp of the original message
at line 97
public string[]
get_outermost_quote_authors(string $xml)
Get a list of quote authors, limited to the outermost quotes
at line 124
public string
remove_bbcode(string $xml, string $bbcode_name, integer $depth)
Remove given BBCode and its content, at given nesting depth
at line 135
public string
unparse(string $xml)
Return a parsed text to its original form
at line 143
public bool
is_empty(string $text)
Return whether or not a parsed text represent an empty text.