-
v0.5.1 (12.11.2015)
- fixed bug leaving part of shortcode text when it contained multibyte characters.
-
v0.5.0 (28.10.2015)
- fixed bug with parent shortcode not being correctly set when there was more than one shortcode at given recursion level,
- fixed bug which caused shortcode content to be returned without modification when auto processing was enabled, there was no handler for that shortcode, but there were handlers for inner shortcodes,
- added example demonstrating how to remove content outside shortcodes,
- added
ProcessedShortcode::getTextContent()to allow returning unprocessed content regardless of auto processing setting value, - added XML and YAML serializers,
- AbstractShortcode::getParameter() does not throw exception for missing parameter without default value,
- removed
create*()methods fromShortcodeFacade, now all dependencies construction is inside the constructor, - removed classes and methods deprecated in previous releases,
- removed
RegexExtractorandExtractorInterface, its functionality was moved toParser- now it returns instances ofParsedShortcodeInterface, - removed
MatchandMatchInterface, - removed
HandlerInterface, from now on handlers can be only closures and classes with__invoke()(callabletypehint), - removed all handler-related methods from
Processor(extracted toHandlerContainer):addHandler(),addHandlerAlias(),setDefaultHandler().
- refactored
ShortcodeFacadeto also useHandlerContainer, alsoSyntaxInterfaceparameter is now required, Processoris now immutable, options setters were refactored to return reconfigured clones:setRecursionDepth()»withRecursionDepth(),setMaxIterations()»withMaxIterations(),setAutoProcessContent()»withAutoProcessContent(),
- extracted
HandlerContainerInterfaceand its default implementationHandlerContainerfromProcessor, Processornow requires instance ofHandlerContainer,- introduced
RegularParserwith dedicated parser implementation that correctly handles nested shortcodes, - introduced
WordpressParserwith slightly refactored implementation of WordPress' regex-based shortcodes in case anyone would like full compatibility, - introduced
ImmutableHandlerContaineras an alternative implementation, - introduced
ProcessorContextto store internal state when processing text, - introduced
AbstractShortcode, restoredfinalon regularShortcode, ProcessedShortcodecan be now created with static methodcreateFromContext()using instance ofProcessorContext,- introduced
ParsedShortcodeandParsedShortcodeInterfacethat extendsShortcodeInterfacewith position and exact text match.
-
v0.4.0 (15.07.2015)
- classes and interfaces were moved to their own namespaces, update your
useclauses and use new names. Backward compatibility was fully maintained, but note that previous class files will be removed in the next release. Old class files contain call toclass_alias()and empty implementation for IDE autocompletion, interfaces extend those from new locations. All modified elements are listed below:Extractor»Parser\RegexExtractor,ExtractorInterface»Extractor\ExtractorInterface,HandlerInterface»Extractor\HandlerInterface,Parser»Parser\RegexParser,ParserInterface»Parser\ParserInterface,Processor»Processor\Processor,ProcessorInterface»Processor\ProcessorInterface,SerializerInterface»Serializer\SerializerInterface,Shortcode»Shortcode\Shortcode,Syntax»Syntax\Syntax,SyntaxBuilder»Syntax\SyntaxBuilder,
- next version of this library will remove all files marked as deprecated (listed above) and will introduce backward incompatible changes to allow finishing refactorings for version 1.0. Sneak peek:
Extractorabstraction will be removed and its functionality will be merged withParser,- processing shortcode content will be moved to its handler,
ProcessedShortcodewill be aware ofProcessorInterfaceinstance that is processing it,HandlerContainerwill be refactored outsideProcessorto remove SRP violation,- various methods will lose their ability to accept nullable parameters to enforce visibility of dependencies,
ProcessedShortcodewill not extendShortcodeandShortcodewill befinalagain,Matchclass will be removed andParsedShortcodewill be introduced in its place,
- introduced
ShortcodeInterfacefor reusable shortcode implementation, handlers should typehint it, - nearly all classes and interfaces were renamed and moved to their own namespaces, see UPGRADE,
- introduced
ProcessedShortcodeto provide more runtime information about context in handlers, - strict syntax capabilities were removed (will be reimplemented in the future),
- introduced
CommonSyntaxwith default values, - introduced
RegexBuilderUtilityto separate regex building fromSyntaxclass, - improved regular expressions which now offer more flexibility,
HandlerInterfacewas deprecated, please use classes with __invoke() method.
- classes and interfaces were moved to their own namespaces, update your
-
v0.3.0 (08.05.2015)
- added support for
[self-closing /]shortcodes, - added library facade for easier usage,
Syntaxregular expressions are now built once in constructor,- added support for whitespace between shortcode fragments, ie.
[ code arg = val ] [ / code ], SyntaxandSyntaxBuildersupport whitespaced and strict syntaxes.
- added support for
-
v0.2.2 (26.04.2015)
- fixed support for PHP 5.3.
-
v0.2.1 (23.04.2015)
- fixed matching simple parameter values enclosed by delimiters,
- fixed missing support for escaping characters inside parameter values.
-
v0.2.0 (17.04.2015)
- added HandlerInterface to enable shortcode handlers with basic validation capabilities,
- added default handler for processing shortcodes without registered name handlers,
- added handler aliasing to reuse name handlers without manually registering them,
- added recursive processing with ability to control recursion depth,
- added iterative processing with ability to control maximum number of iterations,
- added configurable syntax to enable different shortcode formats without modifying library code,
- added syntax builder to ease building
Syntaxobject, - added dash
-to allowed characters in shortcode names, - deprecated
Processor::setRecursion(), useProcessor::setRecursionDepth()instead, - removed regular expressions constants from classes.
-
v0.1.0 (06.04.2015)
- first library version.