parser
class parser implements parser_interface
s9e\TextFormatter\Parser adapter
Properties
protected dispatcher_interface | $dispatcher | ||
protected Parser | $parser |
Methods
Constructor
Parse given text
Disable a specific BBCode
Disable BBCodes in general
Disable the censor
Disable magic URLs
Disable smilies
Enable a specific BBCode
Enable BBCodes in general
Enable the censor
Enable magic URLs
Enable smilies
Get the list of errors that were generated during last parsing
Return the instance of s9e\TextFormatter\Parser used by this object
Set a variable to be used by the parser
Set multiple variables to be used by the parser
Filter the value used in a [size] BBCode
Filter an image's URL to enforce restrictions on its dimensions
Test whether given tag consumes text that looks like BBCode-styled markup
Details
at line 43
__construct(driver_interface $cache, string $key, factory $factory, dispatcher_interface $dispatcher)
Constructor
at line 77
string
parse(string $text)
Parse given text
at line 111
null
disable_bbcode(string $name)
Disable a specific BBCode
at line 119
disable_bbcodes()
Disable BBCodes in general
at line 127
disable_censor()
Disable the censor
at line 135
disable_magic_url()
Disable magic URLs
at line 144
disable_smilies()
Disable smilies
at line 153
null
enable_bbcode(string $name)
Enable a specific BBCode
at line 161
enable_bbcodes()
Enable BBCodes in general
at line 169
enable_censor()
Enable the censor
at line 177
enable_magic_url()
Enable magic URLs
at line 186
enable_smilies()
Enable smilies
at line 198
array[]
get_errors()
Get the list of errors that were generated during last parsing
at line 270
Parser
get_parser()
Return the instance of s9e\TextFormatter\Parser used by this object
at line 278
null
set_var(string $name, mixed $value)
Set a variable to be used by the parser
- max_font_size
- max_img_height
- max_img_width
- max_smilies
- max_urls
at line 297
null
set_vars(array $vars)
Set multiple variables to be used by the parser
at line 315
static mixed
filter_font_size(string $size, int $max_size, Logger $logger)
Filter the value used in a [size] BBCode
at line 343
static string|bool
filter_img_url(string $url, array $url_config, Logger $logger)
Filter an image's URL to enforce restrictions on its dimensions
at line 361
protected bool
is_a_bbcode(Tag $tag)
Test whether given tag consumes text that looks like BBCode-styled markup