Shortcode
Shortcode copied to clipboard
Advanced shortcode (BBCode) parser and engine for PHP
Ideas
Just a list of issues to remember: - [ ] custom exceptions for specific cases rather than using generic ones, - [ ] recipes for specific tasks (like find all...
This event allows applying any operations on the results of all handlers before they are applied to the original text.
Using `CommonSyntax`, the following text won't be picked up by the regular parser: `[url=http://example.com]link[/url]` The parser correctly recognize the opening shortcode, continue to getting the parameter value, then finds a...
Is it possible to use either `Events::FILTER_SHORTCODES` or `Events::REPLACE_SHORTCODES` to modify/extend the replacement string provided by the handler? I am looking for a way to insert additional HTML (say, a...
Testing using my sample string that was causing memory issues for me memory usage was reduced by 46% using refactor. Super simple test, showing peak usage after processing (`aka. memory_get_peak_usage()`)...
Just wondering is `PREG_OFFSET_CAPTURE` is needed here https://github.com/thunderer/Shortcode/blob/65d8b2937430e944c84a0123d2b0dd392c1c85c7/src/Parser/RegularParser.php#L338 I don't see offset used anywhere in the following code however during tests I found that it uses up memory pretty heavily....
It seems there was no method available to set a default handler in ShortcodeFacade, so I added one.
This way `RegularParser` does not even need to have a `switch` block and convoluted logic to match given token type based on the structure returned from `preg_match_all()`, it's just token...