# Change Log All notable changes to this project will be documented in this file. Updates should follow the [Keep a CHANGELOG](https://keepachangelog.com/) principles. ## [0.19.3] - 2019-06-18 ### Fixed - Fixed bug where elements with content of `"0"` wouldn't be rendered (#376) ## [0.19.2] - 2019-05-19 ### Fixed - Fixed bug where default values for nested configuration paths were inadvertently cast to strings ## [0.19.1] - 2019-04-10 ### Added - Added the missing `addExtension()` method to the new `ConfigurableEnvironmentInterface` ### Fixed - Fixed extensions not being able to register other extensions ## [0.19.0] - 2019-04-10 ### Added - The priority of parsers, processors, and renderers can now be set when `add()`ing them; you no longer need to rely on the order in which they are added - Added support for trying multiple parsers per block/inline - Extracted two new base interfaces from `Environment`: - `EnvironmentInterface` - `ConfigurableEnvironmentInterface` - Extracted a new `AbstractStringContainerBlock` base class and corresponding `StringContainerInterface` from `AbstractBlock` - Added `Cursor::getEncoding()` method - Added `.phpstorm.meta.php` file for better IDE code completion - Made some minor optimizations here and there ### Changed - Pretty much everything now has parameter and return types (#346) - Attributes passed to `HtmlElement` will now be escaped by default - `Environment` is now a `final` class - `Environment::getBlockRendererForClass()` was replaced with `Environment::getBlockRenderersForClass()` (note the added `s`) - `Environment::getInlineRendererForClass()` was replaced with `Environment::getInlineRenderersForClass()` (note the added `s`) - The `Environment::get____()` methods now return an iterator instead of an array - `Context::addBlock()` no longer returns the same block instance you passed into the method, as this served no useful purpose - `RegexHelper::isEscapable()` no longer accepts `null` values - `Node::replaceChildren()` now accepts any type of `iterable`, not just `array`s - Some block elements now extend `AbstractStringContainerBlock` instead of `AbstractBlock` - `InlineContainerInterface` now extends the new `StringContainerInterface` - The `handleRemainingContents()` method (formerly on `AbstractBlock`, now on `AbstractStringContainerBlock`) is now an `abstract method - The `InlineParserContext` constructor now requires an `AbstractStringContainerBlock` instead of an `AbstractBlock` ### Removed - Removed support for PHP 5.6 and 7.0 (#346) - Removed support for `add()`ing parsers with just the target block/inline class name - you need to include the full namespace now - Removed the following unused methods from `Environment`: - `getInlineParser($name)` - `getInlineParsers()` - `createInlineParserEngine()` - Removed the unused `getName()` methods: - `AbstractBlockParser::getName()` - `AbstractInlineParser::getName()` - `BlockParserInterface::getName()` - `InlinerParserInterface::getName()` - Removed the now-useless classes: - `AbstractBlockParser` - `AbstractInlinerParser` - `InlineContainer` - Removed the `AbstractBlock::acceptsLines()` method - Removed the now-useless constructor from `AbstractBlock` - Removed previously-deprecated functionality: - `InlineContainer` class - `RegexHelper::$instance` - `RegexHelper::getInstance()` - `RegexHelper::getPartialRegex()` - `RegexHelper::getHtmlTagRegex()` - `RegexHelper::getLinkTitleRegex()` - `RegexHelper::getLinkDestinationBracesRegex()` - `RegexHelper::getThematicBreakRegex()` - Removed the second `$preserveEntities` parameter from `Xml:escape()` ## [0.18.5] - 2019-03-28 ### Fixed - Fixed the adjoining `Text` collapser not handling the full tree (thephpleague/commonmark-ext-autolink#10) ## [0.18.4] - 2019-03-23 ### Changed - Modified how URL normalization decodes certain characters in order to align with the JS library's output - Disallowed unescaped `(` in parenthesized link title ### Fixed - Fixed two exponential backtracking issues ## [0.18.3] - 2019-03-21 This is a **security update** release. ### Changed - XML/HTML entities in attributes will no longer be preserved when rendering (#353) ### Fixed - Fix XSS vulnerability caused by improper preservation of entities when rendering (#353) ### Deprecated - Deprecated the `$preserveEntites` argument of `Xml::escape()` for removal in the next release (#353) ## [0.18.2] - 2019-03-16 ### Fixed - Fixed adjoining `Text` elements not being collapsed after delimiter processing ### Deprecated - Deprecated the `CommonmarkConverter::VERSION` constant for removal in 1.0.0 ## [0.18.1] - 2018-12-29 This is a **security update** release. ### Fixed - Fix XSS vulnerability caused by URL normalization not handling/encoding newlines properly (#337, CVE-2018-20583) ## [0.18.0] - 2018-09-18 ### Added - Added `ConverterInterface` to `Converter` and `CommonMarkConverter` (#330) - Added `ListItem::getListData()` method (#329) ### Changed - Links with `target="_blank"` will also get `rel="noopener noreferrer"` by default (#331) - Implemented several performance optimizations (#324) ## [0.17.5] - 2018-03-29 ### Fixed - Fixed incorrect version constant value (again) - Fixed release checklist to prevent the above from happening - Fixed incorrect dates in CHANGELOG ## [0.17.4] - 2018-03-28 ### Added - Added `ListBlock::setTight()` method ## [0.17.3] - 2018-03-26 ### Fixed - Fixed incorrect version constant value ## [0.17.2] - 2018-03-25 ### Added - Added new `RegexHelper::isEscapable()` method ### Fixed - Fixed spec compliance bug where escaped spaces should not be allowed in link destinations ## [0.17.1] - 2018-03-18 ### Added - Added a new constant containing the current version: `CommonMarkConverter::VERSION` (#314) ## [0.17.0] - 2017-12-30 This release contains several breaking changes and a minimum PHP version bump - see for more details. ### Added - Added new `max_nesting_level` setting (#243) - Added minor performance optimizations to `Cursor` ### Changed - Minimum PHP version is now 5.6.5. - All full and partial regular expressions in `RegexHelper` are now defined as constants instead of being built on-the-fly. - `Cursor::saveState()` now returns an `array` instead of a `CursorState` object. - `Cursor::restoreState()` now accepts an `array` parameter instead of a `CursorState` object. - Saving/restoring the Cursor state no longer tracks things that don't change (like the text content). - `RegexHelper` is now `final`. - References to `InlineContainer` changed to new `InlineContainerInterface` interface. - `MiscExtension::addInlineParser()` and `MiscExtension::addBlockRenderer()` now return `$this` instead of nothing. ### Fixed - Fixed `Reference::normalizeReference()` not properly collapsing whitespace to a single space ### Deprecated - `RegexHelper::getInstance()` and all instance (non-static) methods have been deprecated. - The `InlineContainer` interface has been deprecated. Use `InlineContainerInterface` instead. ### Removed - Removed support for PHP 5.4 and 5.5. - Removed `CursorState` class - Removed all previous deprecations: - `Cursor::getFirstNonSpacePosition()` - `Cursor::getFirstNonSpaceCharacter()` - `Cursor::advanceWhileMatches()` - `Cursor::advanceToFirstNonSpace()` - `ElementRendererInterface::escape()` - `HtmlRenderer::escape()` - `RegexHelper::REGEX_UNICODE_WHITESPACE` - `RegexHelper::getLinkDestinationRegex()` ## [0.16.0] - 2017-10-30 This release contains breaking changes, several performance improvements, and two deprecations: ### Added - Added new `Xml` utility class; moved HTML/XML escaping logic into there (see deprecations below) ### Changed - `Environment::getInlineParsersForCharacter()` now returns an empty array (instead of `null`) when no matching parsers are found - Three utility classes are now marked `final`: - `Html5Entities` - `LinkParserHelper` - `UrlEncoder` ### Fixed - Improved performance of several methods (for a 10% overall performance boost - #292) ### Deprecated The following methods were deprecated and are scheduled for removal in 0.17.0 or 1.0.0 (whichever comes first). See for more information. - `Cursor::advanceWhileMatches()` deprecated; use `Cursor::match()` instead. - `HtmlRenderer::escape()` deprecated; use `Xml::escape()` instead. ### Removed - Removed `DelimiterStack::findFirstMatchingOpener()` which was previously deprecated in 0.15.0 ## [0.15.7] - 2017-10-26 ### Fixed - Improved performance of `Cursor::advanceBy()` (for a 16% performance boost) ## [0.15.6] - 2017-08-08 ### Fixed - Fixed URI normalization not properly encoding/decoding special characters in certain cases (#287) ## [0.15.5] - 2017-08-05 This release bumps spec compliance to 0.28 without breaking changes to the API. ### Added - Project is now tested against PHP 7.2 ### Changed - Bumped CommonMark spec target to 0.28 - Changed internal implementation of `LinkParserHelper::parseLinkDestination()` to allow nested parens - Changed precedence of strong/emph when both nestings are possible (rule 14) - Allow tabs before and after ATX closing header ### Fixed - Fixed HTML type 6 block regex matching against `
` (it shouldn't) and not matching `