utils_interface
interface utils_interface
Used to manipulate a parsed text
In this interface, "plain text" refers to regular text as it would be inputted by a user. "Parsed text" refers to whichever form is returned by the implementation after parsing, which should be suitable to be reinserted into the database.
Methods
Replace BBCodes and other formatting elements with whitespace
Create a quote block for given text
Get a list of quote authors, limited to the outermost quotes
Remove given BBCode and its content, at given nesting depth
Return a parsed text to its original form
Return whether or not a parsed text represent an empty text.
Details
at line 33
string
clean_formatting(string $text)
Replace BBCodes and other formatting elements with whitespace
NOTE: preserves smilies as text
at line 48
string
generate_quote(string $text, array $attributes = array())
Create a quote block for given text
Possible attributes:
- author: author's name (usually a username)
- post_id: post_id of the post being quoted
- user_id: user_id of the user being quoted
- time: timestamp of the original message
at line 56
string[]
get_outermost_quote_authors(string $text)
Get a list of quote authors, limited to the outermost quotes
at line 66
string
remove_bbcode(string $text, string $bbcode_name, int $depth = 0)
Remove given BBCode and its content, at given nesting depth
at line 74
string
unparse(string $text)
Return a parsed text to its original form
at line 82
bool
is_empty(string $text)
Return whether or not a parsed text represent an empty text.