thunderer/shortcode
Framework-agnostic PHP library for parsing and processing shortcodes/BBCodes. Extract shortcodes from text, handle replacements, and apply them via processors and events. Includes serializers for Text/XML/JSON/YAML. Supports PHP 5.3–8.x.
Full Changelog: https://github.com/thunderer/Shortcode/compare/v0.7.6...v0.7.7
Fixed PHP 7.4 compatibility errors reported in #81 and #82.
Fixed #77, merged quality of life improvements from #73.
Fixed #74.
RegularParser improvements and fixes:
T_STRING tokens,preg_match_all() with large inputs was sometimes silently failing and returning only subset of matches which reduced the number of reported shortcodes,content() method effectively halving the call nesting level,xdebug.max_nesting_level during parse() to prevent development environment parsing errors,* is now a valid shortcode name,Processor improvements,Extended parameter simple values possible value range, #44.
Fixed minor WordPress compatibility issue with content detection in WordpressParser.
Fixed bug happening when computing replacement of shortcode without handler that contained multibyte content.
Fixed issue with parsing shortcode tokens inside shortcode content.
Fixed bug with not recalculating new text length after applying shortcode replacement which caused the replacements to be applied only up to the length of source text. Thanks to @Jonatanmdez for reporting it in issue #37.
Events subsystem, builtin event handlers, builtin shortcode handlers, rewritten README, standardized shortcode name validation, ReplacedShortcode to represent handler result instead of internal array, getBaseOffset() and better WordpressParser compatibility with WordPress.
Massive performance improvements in RegularParser, fixed problem with multibyte characters in parsed texts, fixed matching shortcodes with invalid names.
Fixed bug with subsequent string tokens in RegularParser, added corresponding test cases.
Fixed a bug with shortcode replacement when it contained multibyte characters.
Removed all deprecated features from v0.4.0, added XML and YAML serializers, added RegularParser and WordpressParser, added HandlerContainer abstraction. This was meant to be a 1.0.0 release, but I'm still working on several ideas and want to test them before first stable release (should be released soon).
Intermediate release with many fixes and improvements. BC was kept intact, though nearly all classes were moved into new places. Introduced UPGRADE document which describes possible breaking changes in future releases. Next release will be BC breaking and will clean everything.
Whitespaced syntax, library facade and self-closing tags.
Fixed support for PHP 5.3.
Fixed matching simple parameter values using delimiters, added missing support for escaping characters inside parameter values.
Recursive and iterative processing, HandlerInterface, default handler, handler aliases and configurable shortcode syntax with builder.
First release.
How can I help you explore Laravel packages today?