-
v0.6.2 (25.04.2016)
- fixed issue with parsing shortcode tokens inside shortcode content.
-
v0.6.1 (25.02.2016)
- 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.
-
v0.6.0 (13.02.2016)
- README was completely rewritten to take into account newest additions,
- introduced
FilterShortcodesEventfor modifying set of parsed shortcodes before processing them, - introduced
ReplaceShortcodesEventto alter the way shortcode replacements are applied to source text at each processing level, - introduced
EventContainerInterfacewith default implementationEventContainerto store event handlers, - introduced events handling in
Processorwith events above, - added
Processor::withEventContainer()to configure event handlers, - added
ProcessedShortcode::hasAncestor()to detect if shortcode has any parent with given name, - introduced
ReplacedShortcodewhich represents parsed shortcode data with replacement returned from its handler, - introduced ready to use event handlers classes:
FilterRawEventHandlerallows to automatically configure shortcodes that should not have their content processed,ReplaceJoinEventHandlerdiscards the parent shortcode content and returns only concatenated replacements,
- fixed
HandlerContainer::addAlias()bug that may have silently added aliases for default handler, - added possibility to create
WordpressParserwith names from array orHandlerContainerto catch only those like WordPress does, - fixed differences between parsers and standardized validating allowed characters in their names in
RegexBuilderUtility::buildNameRegex() - introduced several ready to use shortcode handlers described in dedicated section of README,
- refactored
ShortcodeFacadefor better developer experience.
-
v0.5.3 (26.01.2016)
- massive performance improvements in RegularParser,
- fixed problem with multibyte characters in parsed texts,
- fixed matching shortcodes with invalid names.
-
v0.5.2 (20.01.2016)
- fixed bug with subsequent string tokens in RegularParser.
-
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.