Changelog
All notable changes made in 1.x
releases are shown below. See the full list of releases for the complete changelog.
1.6.7 - 2022-01-13
Changed
- Added
ReturnTypeWillChange
attribute to prevent PHP 8.1 deprecation warnings (#785) - Coerced punctuation counts to integers to ensure floats are never used
1.6.6 - 2021-07-17
Fixed
- Fixed Mentions inside of links creating nested links against the spec’s rules (#688)
1.6.5 - 2021-06-26
Changed
- Simplified checks for thematic breaks
Fixed
- Fixed ExternalLinkProcessor not handling autolinks by adjusting its priority to -50 (#681)
1.6.4 - 2021-06-19
Changed
- Optimized attribute parsing to avoid inspecting every space character (30% performance boost)
1.6.3 - 2021-06-19
Fixed
- Fixed incorrect parsing of tilde-fenced code blocks with leading spaces (#676)
1.6.2 - 2021-05-12
Fixed
- Fixed incorrect error level for deprecation notices
1.6.1 - 2021-05-08
Fixed
- Fixed
HeadingPermalinkProcessor
skipping text contents from certain nodes (#615)
1.6.0 - 2021-05-01
Please see https://commonmark.thephpleague.com/1.6/upgrading/ for important information about this release and the upcoming 2.0.0 version.
Added
- Added forward-compatibility for configuration options which will be changing in 2.0:
commonmark/enable_em
(currentlyenable_em
in 1.x)commonmark/enable_strong
(currentlyenable_strong
in 1.x)commonmark/use_asterisk
(currentlyuse_asterisk
in 1.x)commonmark/use_underscore
(currentlyuse_underscore
in 1.x)commonmark/unordered_list_markers
(currentlyunordered_list_markers
in 1.x)mentions/*/prefix
(currentlymentions/*/symbol
in 1.x)mentions/*/pattern
(currentlymentions/*/regex
in 1.x)max_nesting_level
(currently supportsint
andfloat
values in 1.x; will only supportint
in 2.0)
- Added new
MarkdownConverter
class for creating converters with custom environments; this replaces the previously-deprecatedConverter
class - Added new
RegexHelper::matchFirst()
method - Added new
Configuration::exists()
method
Changed
- The
max_nesting_level
option now defaults toPHP_INT_MAX
instead ofINF
Deprecated
- Deprecated the configuration options shown above
- Deprecated the ability to pass a custom
Environment
into the constructors ofCommonMarkConverter
andGithubFlavoredMarkdownConverter
; useMarkdownConverter
instead - Deprecated
ConfigurableEnvironmentInterface::setConfig()
; usemergeConfig()
instead - Deprecated calling
ConfigurableEnvironmentInterface::mergeConfig()
without any parameters - Deprecated calling
Configuration::get()
andEnvironmentInterface::getConfig()
without any parameters - Deprecated calling
Configuration::set()
without the second$value
parameter - Deprecated
RegexHelper::matchAll()
; useRegexHelper::matchFirst()
instead - Deprecated extending the
ArrayCollection
class; will be markedfinal
in 2.0
Fixed
- Fixed missing check for empty arrays being passed into the
unordered_list_markers
configuration option
1.5.8 - 2021-03-28
Fixed
- Fixed Table of Contents not rendering heading inlines properly (#587, #588)
- Fixed parsing of tables within list items (#590)
1.5.7 - 2020-10-31
Fixed
- Fixed mentions not being parsed when appearing after non-word characters (#582)
1.5.6 - 2020-10-17
Changed
- Blocks added outside of the parsing context now have their start/end line numbers defaulted to 0 to avoid type errors (#579)
Fixed
- Fixed replacement blocks not inheriting the start line number of the container they’re replacing (#579)
- Fixed Table of Contents blocks not having correct start/end line numbers (#579)
1.5.5 - 2020-09-13
Changed
- Bumped CommonMark spec compliance to 0.28.2
Fixed
- Fixed
textarea
elements not being treated as a type 1 HTML block (likescript
,style
, orpre
) - Fixed autolink processor not handling other unmatched trailing parentheses
1.5.4 - 2020-08-18
Fixed
- Fixed footnote ID configuration not taking effect (#524, #530)
- Fixed heading permalink slugs not being unique (#531, #534)
1.5.3 - 2020-07-19
Fixed
- Fixed regression of multi-byte inline parser characters not being matched
1.5.2 - 2020-07-19
Changed
- Significantly improved performance of the inline parser regex
Fixed
- Fixed parent class lookups for non-existent classes on PHP 8 (#517)
1.5.1 - 2020-06-27
Fixed
- Fixed UTF-8 encoding not being checked in the
UrlEncoder
utility (#509) or theCursor
1.5.0 - 2020-06-21
Added
- Added new
AttributesExtension
based on https://github.com/webuni/commonmark-attributes-extension (#474) - Added new
FootnoteExtension
based on https://github.com/rezozero/commonmark-ext-footnotes (#474) - Added new
MentionExtension
to replaceInlineMentionParser
with more flexibility and customization - Added the ability to render
TableOfContents
nodes anywhere in a document (given by a placeholder) - Added the ability to properly clone
Node
objects - Added options to customize the value of
rel
attributes set via theExternalLink
extension (#476) - Added a new
heading_permalink/slug_normalizer
configuration option to allow custom slug generation (#460) - Added a new
heading_permalink/symbol
configuration option to replace the now deprecatedheading_permalink/inner_contents
configuration option (#505) - Added
SlugNormalizer
andTextNormalizer
classes to make normalization reusable by extensions (#485) - Added new classes:
TableOfContentsGenerator
TableOfContentsGeneratorInterface
TableOfContentsPlaceholder
TableOfContentsPlaceholderParser
TableOfContentsPlaceholderRenderer
Changed
- “Moved” the
TableOfContents
class into a newNode
sub-namespace (with backward-compatibility) - Reference labels are now generated and stored in lower-case instead of upper-case
- Reference labels are no longer normalized inside the
Reference
, only theReferenceMap
Fixed
- Fixed reference label case folding polyfill not being consistent between different PHP versions
Deprecated
- Deprecated the
CommonMarkConverter::VERSION
constant (#496) - Deprecated
League\CommonMark\Extension\Autolink\InlineMentionParser
(useLeague\CommonMark\Extension\Mention\MentionParser
instead) - Deprecated everything under
League\CommonMark\Extension\HeadingPermalink\Slug
(use the classes underLeague\CommonMark\Normalizer
instead) - Deprecated
League\CommonMark\Extension\TableOfContents\TableOfContents
(use the one in the newNode
sub-namespace instead) - Deprecated the
STYLE_
andNORMALIZE_
constants inTableOfContentsBuilder
(use the ones inTableOfContentsGenerator
instead) - Deprecated the
\League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkRenderer::DEFAULT_INNER_CONTENTS
constant (#505) - Deprecated the
heading_permalink/inner_contents
configuration option in theHeadingPermalink
extension (use the newheading_permalink/symbol
configuration option instead) (#505)
1.4.3 - 2020-05-04
Fixed
- Fixed certain Unicode letters, numbers, and marks not being preserved when generating URL slugs (#467)
1.4.2 - 2020-04-24
Fixed
- Fixed inline code blocks not be included within heading permalinks (#457)
1.4.1 - 2020-04-20
Fixed
- Fixed BC break caused by ConverterInterface alias not being used by some DI containers (#454)
1.4.0 - 2020-04-18
Added
- Added new Heading Permalink extension (#420)
- Added new Table of Contents extension (#441)
- Added new
MarkdownConverterInterface
as a long-term replacement forConverterInterface
(#439) - Added new
DocumentPreParsedEvent
event (#427, #359, #399) - Added new
ListBlock::TYPE_BULLET
constant as a replacement forListBlock::TYPE_UNORDERED
- Added new
MarkdownInput
class andMarkdownInputInterface
to handle pre-parsing and allow listeners to replace Markdown contents
Changed
- Block & inline renderers will now render child classes automatically (#222, #209)
- The
ListBlock
constants now use fully-lowercased values instead of titlecased values - Significantly improved typing
Fixed
- Fixed loose comparison when checking for table alignment
- Fixed
StaggeredDelimiterProcessor
returning from avoid
function
Deprecated
- The
Converter
class has been deprecated; useCommonMarkConverter
instead (#438, #439) - The
ConverterInterface
has been deprecated; useMarkdownConverterInterface
instead (#438, #439) - The
bin/commonmark
script has been deprecated - The following methods of
ArrayCollection
have been deprecated:add()
set()
get()
remove()
isEmpty()
contains()
indexOf()
containsKey()
replaceWith()
removeGaps()
- The
ListBlock::TYPE_UNORDERED
constant has been deprecated, useListBlock::TYPE_BULLET
instead
1.3.4 - 2020-04-13
Fixed
- Fixed configuration/environment not being injected into event listeners when adding them via
[$instance, 'method']
callable syntax (#440)
1.3.3 - 2020-04-05
Fixed
- Fixed event listeners not having the environment or configuration injected if they implemented the
EnvironmentAwareInterface
orConfigurationAwareInterface
(#423)
1.3.2 - 2020-03-25
Fixed
- Optimized URL normalization in cases where URLs don’t contain special characters (#417, #418)
1.3.1 - 2020-02-28
Fixed
- Fixed return types of
Environment::createCommonMarkEnvironment()
andEnvironment::createGFMEnvironment()
1.3.0 - 2020-02-09
ℹ️ Do you use league/commonmark-ext*
packages? Those features are now included directly in this library! See #409 for details on making the switch.
Added
- Added (optional) full GFM support! 🎉🎉🎉 (#409)
- Added check to ensure Markdown input is valid UTF-8 (#401, #405)
- Added new
unordered_list_markers
configuration option (#408, #411)
Changed
- Introduced several micro-optimizations for a 5-10% performance boost
1.2.2 - 2020-01-16
This release contains the same changes as 1.1.3:
Fixed
- Fixed link parsing edge case (#403)
1.1.3 - 2020-01-16
Fixed
- Fixed link parsing edge case (#403)
1.2.1 - 2020-01-15
Changed
- Introduced several micro-optimizations, reducing the parse time by 8%
1.2.0 - 2020-01-09
Changed
- Removed URL decoding step before encoding (more performant and better matches the JS library)
- Removed redundant token from HTML tag regex
1.1.2 - 2019-12-10
Fixed
- Fixed URL normalization not handling non-UTF-8 sequences properly (#395, #396)
1.1.1 - 2019-11-11
Fixed
- Fixed handling of link destinations with unbalanced unescaped parens
- Fixed adding delimiters to stack which can neither open nor close a run
1.1.0 - 2019-10-31
Added
- Added a new
Html5EntityDecoder
class (#387)
Changed
- Improved performance by 10% (#389)
- Made entity decoding less memory-intensive (#386, #387)
Fixed
- Fixed PHP 7.4 compatibility issues
Deprecated
- Deprecated the
Html5Entities
class - useHtml5EntityDecoder
instead (#387)
1.0.0 - 2019-06-29
First stable release! 🎉
No code changes have been introduced since 1.0.0-rc1
1.0.0-rc1 - 2019-06-20
Added
- Extracted a
ReferenceMapInterface
from theReferenceMap
class - Added optional
ReferenceMapInterface
parameter to theDocument
constructor
Changed
- Replaced all references to
ReferenceMap
withReferenceMapInterface
ReferenceMap::addReference()
no longer returns$this
Fixed
- Fixed bug where elements with content of
"0"
wouldn’t be rendered (#376)
1.0.0-beta4 - 2019-06-05
Added
- Added event dispatcher functionality (#359, #372)
Removed
- Removed
DocumentProcessorInterface
functionality in favor of event dispatching (#373)
1.0.0-beta3 - 2019-05-28
Changed
- Made the
Delimiter
class final and extracted a newDelimiterInterface
- Modified most external usages to use this new interface
- Renamed three
Delimiter
methods:getOrigDelims()
renamed togetOriginalLength()
getNumDelims()
renamed togetLength()
setNumDelims()
renamed tosetLength()
- Made additional classes final:
DelimiterStack
ReferenceMap
ReferenceParser
- Moved
ReferenceParser
into theReference
sub-namespace
Removed
- Removed unused
Delimiter
methods:setCanOpen()
setCanClose()
setChar()
setIndex()
setInlineNode()
- Removed fluent interface from
Delimiter
(setter methods now have no return values)
1.0.0-beta2 - 2019-05-27
This beta release fixes a couple of items that were not addressed in the previous beta.
Changed
DelimiterProcessorInterface::process()
will accept any type ofAbstractStringContainer
now, not justText
nodes- The
Delimiter
constructor,getInlineNode()
, andsetInlineNode()
no longer accept genericNode
elements - onlyAbstractStringContainer
s
Removed
- Removed all deprecated functionality:
- The
safe
option (usehtml_input
andallow_unsafe_links
options instead) - All deprecated
RegexHelper
constants DocParser::getEnvironment()
(you should obtain it some other way)AbstractInlineContainer
(useAbstractInline
instead and makeisContainer()
returntrue
)
- The
1.0.0-beta1 - 2019-05-26
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
Older Versions
Please see the full list of releases for the complete changelog.