Releases: thephpleague/commonmark
Releases · thephpleague/commonmark
0.13.0
Added
- Added AST document processors (#210)
- Added optional
Environment
parameter toCommonMarkConverter
constructor
Changed
- Renamed "header" things to "heading" for spec consistency
Header
=>Heading
ATXHeaderParser
=>ATXHeadingParser
SetExtHeaderParser
=>SetExtHeadingParser
HeaderRenderer
=>HeadingRenderer
- Renamed "HorizontalRule" to "ThematicBreak" for spec consistency
HorizontalRule
=>ThematicBreak
HorizontalRuleParser
=>ThematicBreakParser
HorizontalRuleRenderer
=>ThematicBreakRenderer
HorizontalRuleRendererTest
=>ThematicBreakRendererTest
RegexHelper::getHRuleRegex()
=>RegexHelper::getThematicBreakRegex()
- Renamed inline "Html" and "RawHtml" to "HtmlInline" for consistency
Html
=>HtmlInline
RawHtmlParser
=>HtmlInlineParser
RawHtmlRenderer
=>HtmlInlineRenderer
- Don't allow whitespace between link text and link label of a reference link (spec change)
- Don't allow spaces in link destinations, even in
<>
- Allow multiline setext header content
- The
Heading
constructor now allows$contents
to be astring
(old behavior) orstring[]
(new)
- The
Fixed
- Fixed several list issues and regressions (commonmark/commonmark.js#59)
Removed
- Removed schema whitelist from autolink regex
- Moved SmartPunct functionality into new league/commonmark-extras package
0.12.0
Added
- Added ability to configure characters and disable emphasis/strong (#135)
- Added new ConfigurationAwareInterface support for all parsers, processors, and renderers (#201)
- Added HTML safe mode to handle untrusted input (#200, #201)
- Safe mode is disabled by default for backwards-compatibility
- To enable it, set the
safe
option totrue
- Added AppVeyor integration for automated unit/functional testing on Windows (#195)
Changed
AbstractBlock::finalize()
now reqires a second parameter,$endLineNumber
RegexHelper::REGEX_ENTITY
no longer includes the starting/
or the ending/i
(#194)Node::setParent()
now accepts null values (#203)
Fixed
- Fixed incorrect
endLine
positions (#187) - Fixed
DocParser::preProcessInput
dropping up to 2 ending newlines instead of just one - Fixed
EntityParser
not checking for ampersands at the start of the current position (#192, #194)
Removed
0.11.3
Fixed
- Reset container after closing containing lists (#183; commonmark/commonmark.js#67)
- The temporary fix from 0.11.2 was reverted
0.11.2
0.11.1
Changed
- Tightened up some loose comparisons
Fixed
- Fixed missing "bin" directive in composer.json
- Updated a docblock to match recent changes to method parameters
Removed
- Removed unused variable from within QuoteProcessor's closure
0.11.0
This release contains several major internal changes. It will likely break compatibility with custom elements, parsers, and renderers. Simple Markdown parsing is unaffected.
Added
- Added new
Node
class, which bothAbstractBlock
andAbstractInline
extend from (#169) - Added a
NodeWalker
andNodeWalkerEvent
to traverse the AST without using recursion - Added new
InlineContainer
interface for blocks - Added new
getContainer()
andgetReferenceMap()
methods toInlineParserContext
- Added
iframe
to whitelist of HTML block tags (as per spec) - Added
./bin/commonmark
for converting Markdown at the command line
Changed
- Bumped spec target version to 0.22
- Revised AST to use a double-linked list (#169)
AbstractBlock
andAbstractInline
both extend fromNode
- Sub-classes must implement new
isContainer()
method
- Sub-classes must implement new
- Other major changes to
AbstractBlock
:getParent()
is nowparent()
setParent()
now expects aNode
instead of anAbstractBlock
getChildren()
is nowchildren()
getLastChild()
is nowlastChild()
addChild()
is nowappendChild()
InlineParserContext
is constructed using the containerAbstractBlock
and the document'sRefereceMap
- The constructor will automatically create the
Cursor
using the container's string contents
- The constructor will automatically create the
InlineParserEngine::parse
now requires theNode
container and the document'sReferenceMap
instead of aContextInterface
andCursor
- Changed
Delimiter
to reference the actual inlineNode
instead of the position- The
int $pos
protected member and constructor arg is nowNode $node
- Use
getInlineNode()
andsetInlineNode()
instead ofgetPos()
andsetPos()
- The
- Changed
DocParser::processInlines
to use aNodeWalker
to iterate through inlines- Walker passed as second argument instead of
AbstractBlock
- Uses a
while
loop instead of recursion to traverse the AST
- Walker passed as second argument instead of
Image
andLink
now only accept a string as their second argument- Refactored how
CloseBracketParser::parse()
works internally CloseBracketParser::createInline
no longer accepts label inlines- Disallow list item starting with multiple blank lines (see commonmark/commonmark-spec#332)
- Modified
AbstractBlock::setLastLineBlank()
- Functionality moved to
AbstractBlock::shouldLastLineBeBlank()
and newDocParser::setAndPropagateLastLineBlank()
method AbstractBlock::setLastLineBlank()
is now a setter method forAbstractBlock::$lastLineBlank
- Functionality moved to
AbstractBlock::handleRemainingContents()
is no longer abstract- A default implementation is provided
- Removed duplicate code from sub-classes which used the default implementation - they'll just use the parent method from now on
Fixed
- Fixed logic error in calculation of offset (see commonmark/commonmark.js@94053a8)
- Fixed bug where
DocParser
checked the wrong method to determine remainder handling behavior - Fixed bug where
HorizontalRuleParser
failed to advance the cursor beyond the parsed horizontal rule characters - Fixed
DocParser
not ignoring the final newline of the input (like the reference parser does)
Removed
- Removed
Block\Element\AbstractInlineContainer
- Extend
AbstractBlock
and implementInlineContainer
instead - Use child methods instead of
getInlines
andsetInlines
- Extend
- Removed
AbstractBlock::replaceChild()
- Call
Node::replaceWith()
directly the child node instead
- Call
- Removed the
getInlines()
method fromInlineParserContext
- Add parsed inlines using
$inlineContext->getContainer()->appendChild()
instead of$inlineContext->getInlines()->add()
- Add parsed inlines using
- Removed the
ContextInterface
argument fromAbstractInlineParser::parse()
andInlineParserEngine::parseCharacter
- Removed the first
ArrayCollection $inlines
argument fromInlineProcessorInterface::processInlines()
- Removed
CloseBracketParser::nullify()
- Removed
pre
from rule 6 of HTML blocks (see commonmark/commonmark-spec#355)
0.10.0
Added
- Added parent references to inline elements (#124)
- Added smart punctuation extension (#134)
- Added HTML block types
- Added indentation caching to the cursor
- Added automated code style checks (#133)
- Added support for tag attributes in renderers (#101, #165)
Changed
- Bumped spec target version to 0.21
- Revised HTML block parsing to conform to new spec (commonmark/commonmark.js@99bd473)
- Imposed 9-digit limit on ordered list markers, per spec
- Allow non-initial hyphens in html tag names (commonmark/commonmark-spec#239)
- Updated list of block tag names
- Changed tab/indentation handling to meet the new spec behavior
- Modified spec tests to show spaces and tabs in test results
- Replaced
HtmlRendererInterface
withElementRendererInterface
(#141) - Removed the unnecessary
trim()
and string cast fromListItemRenderer
Fixed
- Fixed link reference definition edge case (#120)
- Allow literal (non-escaping) backslashes in link destinations (#118)
- Allow backslash-escaped backslashes in link labels (#119)
- Allow link labels up to 999 characters (per the spec)
- Properly split on whitespace when determining code block class (commonmark/commonmark.js#54)
- Fixed code style issues (#132, #133, #151, #152)
- Fixed wording for invalid inline exception (#136)
Removed
- Removed the advance-by-one optimization due to added cursor complexity
0.9.0
Added
- Added public $data array to block elements (#95)
- Added
isIndented
helper method toCursor
- Added a new
Converter
base class whichCommonMarkConverter
extends from (#105)
Changed
- Bumped spec target version to 0.20 (#112)
- Renamed
ListBlock::$data
andListItem::$data
to$listData
- Require link labels to contain non-whitespace (commonmark/commonmark-spec#322)
- Use U+FFFD for entities resolving to 0 (commonmark/commonmark-spec#323)
- Moved
IndentedCodeParser::CODE_INDENT_LEVEL
toCursor::INDENT_LEVEL
- Changed arrays to short syntax (#116)
- Improved efficiency of DelimiterStack iteration (commonmark/commonmark.js#43)
Fixed
- Fixed open block tag followed by newline not being recognized (commonmark/commonmark-spec#324)
- Fixed indented lists sometimes being parsed incorrectly (commonmark/commonmark.js#42)
0.8.0
Added
- Allow swapping built-in renderers without using their fully qualified names (#84)
- Lots of unit tests (for existing code)
- Ability to include arbitrary functional tests in addition to spec-based tests
Changed
- Dropped support for PHP 5.3 (#64 and #76)
- Bumped spec target version to 0.19
- Made the AbstractInlineContainer be abstract
- Moved environment config. logic into separate class
Fixed
- Fixed underscore emphasis to conform to spec changes (commonmark/commonmark-spec#317)