Releases: thephpleague/commonmark
1.0.0-beta1
See the upgrading guide for additional information.
Added
- Added proper support for delimiters, including custom delimiters
addDelimiterProcessor()
added toConfigurableEnvironmentInterface
andEnvironment
- Basic delimiters no longer need custom parsers - they'll be parsed automatically
- Added new methods:
AdjacentTextMerger::mergeTextNodesBetweenExclusive()
CommonMarkConveter::getEnvironment()
Configuration::set()
- Extracted some new interfaces from base classes:
DocParserInterface
created fromDocParser
ConfigurationInterface
created fromConfiguration
ReferenceInterface
created fromReference
Changed
- Renamed several methods of the
Configuration
class:getConfig()
renamed toget()
mergeConfig()
renamed tomerge()
setConfig()
renamed toreplace()
- Changed
ConfigurationAwareInterface::setConfiguration()
to accept the newConfigurationInterface
instead of the concrete class - Renamed the
AdjoiningTextCollapser
class toAdjacentTextMerger
- Replaced its
collapseTextNodes()
method with the newmergeChildNodes()
method
- Replaced its
- Made several classes
final
:Configuration
DocParser
HtmlRenderer
InlineParserEngine
NodeWalker
Reference
- All of the block/inline parsers and renderers
- Reduced visibility of several internal methods to
private
:DelimiterStack::findEarliest()
- All
protected
methods inInlineParserEngine
- Marked some classes and methods as
@internal
ElementRendererInterface
now requires a publicrenderInline()
method; added this toHtmlRenderer
- Changed
InlineParserEngine::parse()
to require anAbstractStringContainerBlock
instead of the genericNode
class - Un-deprecated the
CommonmarkConverter::VERSION
constant - The
Converter
constructor now requires an instance ofDocParserInterface
instead of the concreteDocParser
- Changed
Emphasis
,Strong
, andAbstractWebResource
to directly extendAbstractInline
instead of the (now-deprecated) intermediaryAbstractInlineContainer
class
Fixed
- Fixed null errors when inserting sibling
Node
s without parents - Fixed
NodeWalkerEvent
not requiring aNode
via its constructor - Fixed
Reference::normalizeReference()
improperly converting to uppercase instead of performing proper Unicode case-folding - Fixed strong emphasis delimiters not being preserved when
enable_strong
is set tofalse
(it now works identically toenable_em
)
Deprecated
- Deprecated
DocParser::getEnvironment()
(you should obtain it some other way) - Deprecated
AbstractInlineContainer
(useAbstractInline
instead and makeisContainer()
returntrue
)
Removed
- Removed inline processor functionality now that we have proper delimiter support:
- Removed
addInlineProcessor()
fromConfigurableEnvironmentInterface
andEnvironment
- Removed
getInlineProcessors()
fromEnvironmentInterface
andEnvironment
- Removed
EmphasisProcessor
- Removed
InlineProcessorInterface
- Removed
- Removed
EmphasisParser
now that we have proper delimiter support - Removed support for non-UTF-8-compatible encodings
- Removed
getEncoding()
fromContextInterface
- Removed
getEncoding()
,setEncoding()
, and$encoding
fromContext
- Removed
getEncoding()
and the second$encoding
constructor param fromCursor
- Removed
- Removed now-unused methods
- Removed
DelimiterStack::getTop()
(no replacement) - Removed
DelimiterStack::iterateByCharacters()
(use the newprocessDelimiters()
method instead) - Removed the protected
DelimiterStack::findMatchingOpener()
method
- Removed
0.19.2
Fixed
- Fixed bug where default values for nested configuration paths were inadvertently cast to strings
0.19.1
0.19.1 is an immediate follow-up to 0.19.0 which fixes issues with extensions that register other extensions.
(While this technically introduces a BC-break, it's allowed under SemVer's rules for 0.x releases and is necessary for 0.19.x code to work as expected.)
Added
- Added the missing
addExtension()
method to the newConfigurableEnvironmentInterface
Fixed
- Fixed extensions not being able to register other extensions
0.19.0
The 50th release of league/commonmark
is here! 🎉
The Environment
and extension framework underwent some major changes in this release. Be sure to read the upgrade notes if you maintain any community extensions or have written custom functionality on top of this library.
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 correspondingStringContainerInterface
fromAbstractBlock
- 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 afinal
classEnvironment::getBlockRendererForClass()
was replaced withEnvironment::getBlockRenderersForClass()
(note the addeds
)Environment::getInlineRendererForClass()
was replaced withEnvironment::getInlineRenderersForClass()
(note the addeds
)- 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 purposeRegexHelper::isEscapable()
no longer acceptsnull
valuesNode::replaceChildren()
now accepts any type ofiterable
, not justarray
s- Some block elements now extend
AbstractStringContainerBlock
instead ofAbstractBlock
InlineContainerInterface
now extends the newStringContainerInterface
- The
handleRemainingContents()
method (formerly onAbstractBlock
, now onAbstractStringContainerBlock
) is now an `abstract method - The
InlineParserContext
constructor now requires anAbstractStringContainerBlock
instead of anAbstractBlock
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
classRegexHelper::$instance
RegexHelper::getInstance()
RegexHelper::getPartialRegex()
RegexHelper::getHtmlTagRegex()
RegexHelper::getLinkTitleRegex()
RegexHelper::getLinkDestinationBracesRegex()
RegexHelper::getThematicBreakRegex()
- Removed the second
$preserveEntities
parameter fromXml:escape()
0.18.5
Fixed
- Fixed the adjoining
Text
collapser not handling the full tree (thephpleague/commonmark-ext-autolink#10)
0.18.4
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
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 ofXml::escape()
for removal in the next release (#353)
0.18.2
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
This release contains an important security update for CVE-2018-20583.
Fixed
- Fix XSS vulnerability caused by URL normalization not handling/encoding newlines properly (#337, CVE-2018-20583)
0.18.0
No breaking changes were introduced, but we did add a new interface: ConverterInterface
. Consider depending on this interface in your code instead of the concrete implementation. (See #330)
Added
- Added
ConverterInterface
toConverter
andCommonMarkConverter
(#330) - Added
ListItem::getListData()
method (#329)