Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.
FencedCodeRenderer
: don't add language-
to class if already prefixedFull Changelog: https://github.com/thephpleague/commonmark/compare/2.4.1...2.4.2
See the upgrading guide for more information about the exception-related changes
CommonMarkException
marker interface for all exceptions thrown by the libraryAlreadyInitializedException
InvalidArgumentException
IOException
LogicException
MissingDependencyException
NoMatchingRendererException
ParserLogicException
heading_permalink/apply_id_to_heading
- When true
, the id
attribute will be applied to the heading element itself instead of the <a>
tagheading_permalink/heading_class
- class to apply to the heading elementheading_permalink/insert
- now accepts none
to prevent the creation of the <a>
linktable/alignment_attributes
configuration option to control how table cell alignment is rendered (#959)RuntimeException
to LogicException
(or something extending it), including:
CallbackGenerator
s that fail to set a URL or return an expected valueMarkdownParser
when deactivating the last block parser or attempting to get an active block parser when they've all been closedEnvironment
Node
when no renderer has been registered for itHeadingPermalinkProcessor
now throws InvalidConfigurationException
instead of RuntimeException
when invalid config values are given.HtmlElement::setAttribute()
no longer requires the second parameter for boolean attributes@throws
docblocks throughout the codebase, including ConverterInterface
, MarkdownConverter
, and MarkdownConverterInterface
.
\RuntimeException
s were thrown, which was inaccurate as \LogicException
s were also possible.EmbedStartParser
to always capture embed-like lines in container blocks, regardless of parent block typeEmbedProcessor
to also remove Embed
blocks that aren't direct children of the Document
EmbedProcessor
to 1010
EmbedExtension
not parsing embeds following a list block (#898)