All notable changes to this project will be documented in this file. Updates should follow the Keep a CHANGELOG principles.
AbstractBlock::finalize()
now reqires a second parameter,$endLineNumber
- Fixed incorrect
endLine
positions (#187) - Fixed
DocParser::preProcessInput
dropping up to 2 ending newlines instead of just one
- Removed protected function Context::addChild()
- It was a duplicate of the Context::addBlock() method
0.11.3 - 2015-09-25
- Reset container after closing containing lists (#183; commonmark/commonmark.js#67)
- The temporary fix from 0.11.2 was reverted
0.11.2 - 2015-09-23
- Fixed parser checking acceptsLines on the wrong element (#183)
0.11.1 - 2015-09-22
- Tightened up some loose comparisons
- Fixed missing "bin" directive in composer.json
- Updated a docblock to match recent changes to method parameters
- Removed unused variable from within QuoteProcessor's closure
0.11.0 - 2015-09-19
- 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
- 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 logic error in calculation of offset (see jgm/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
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 - 2015-07-25
- 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)
- Bumped spec target version to 0.21
- Revised HTML block parsing to conform to new spec (jgm/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 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 the advance-by-one optimization due to added cursor complexity
0.9.0 - 2015-06-18
- Added public $data array to block elements (#95)
- Added
isIndented
helper method toCursor
- Added a new
Converter
base class whichCommonMarkConverter
extends from (#105)
- Bumped spec target version to 0.20 (#112)
- Renamed ListBlock::$data and ListItem::$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 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 - 2015-04-29
- 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
- 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 underscore emphasis to conform to spec changes (commonmark/commonmark-spec#317)
- Removed PHP 5.3 workaround (see commit 5747822)
- Removed unused AbstractWebResource::setUrl() method
- Removed unnecessary check for hrule when parsing lists (#85)
0.7.2 - 2015-03-08
- Bumped spec target version to 0.18
- Fixed broken parsing of emphasized text ending with a '0' character (#81)
0.7.1 - 2015-03-01
- All references can now be obtained from the
ReferenceMap
vialistReferences()
(#73) - Test against PHP 7.0 (nightly) but allow failures
- ListData::$start now defaults to null instead of 0 (#74)
- Replace references to HtmlRenderer with new HtmlRendererInterface
- Fixed 0-based ordered lists starting at 1 instead of 0 (#74)
- Fixed errors parsing multi-byte characters (#78 and #79)
0.7.0 - 2015-02-16
- More unit tests to increase code coverage
- Enabled the InlineParserEngine to parse several non-special characters at once (performance boost)
- NewlineParser no longer attempts to parse spaces; look-behind is used instead (major performance boost)
- Moved closeUnmatchedBlocks into its own class
- Image and link elements now extend AbstractInlineContainer; label data is stored via $inlineContents instead
- Renamed AbstractInlineContainer::$inlineContents and its getter/setter
- Removed the InlineCollection class
- Removed the unused ArrayCollection::splice() method
- Removed impossible-to-reach code in Cursor::advanceToFirstNonSpace
- Removed unnecessary test from the InlineParserEngine
- Removed unnecessary/unused RegexHelper::getMainRegex() method
0.6.1 - 2015-01-25
- Bumped spec target version to 0.17
- Updated emphasis parsing for underscores to prevent intra-word emphasis
- Deferred closing of fenced code blocks
0.6.0 - 2015-01-09
- Bulk registration of parsers/renderers via extensions (#45)
- Proper UTF-8 support, especially in the Cursor; mbstring extension is now required (#49)
- Environment is now configurable; options can be accessed in its parsers/renderers (#56)
- Added some unit tests
- Bumped spec target version to 0.15 (#50)
- Parsers/renderers are now lazy-initialized (#52)
- Some private elements are now protected for easier extending, especially on Element classes (#53)
- Renderer option keys changed from camelCase to underscore_case (#56)
- Moved CommonMark parser/render definitions into CommonMarkCoreExtension
- Improved parsing of emphasis around punctuation
- Improved regexes for CDATA and HTML comments
- Fixed issue with HTML content that is considered false in loose comparisons, like
'0'
(#55) - Fixed DocParser trying to add empty strings to closed containers (#58)
- Fixed incorrect use of a null parameter value in the HtmlElementTest
- Removed unused ReferenceDefinition* classes (#51)
- Removed UnicodeCaseFolder in favor of mb_strtoupper
0.5.1 - 2014-12-27
- Fixed infinite loop and link-in-link-in-image parsing (#37)
- Removed hard dependency on mbstring extension; workaround used if not installed (#38)
0.5.0 - 2014-12-24
- Support for custom directives, parsers, and renderers
- Major refactoring to de-couple directives from the parser, support custom directive functionality, and reduce complexity
- Updated references to stmd.js in README and docblocks
- Modified CHANGELOG formatting
- Improved travis configuration
- Put tests in autoload-dev
- Fixed CommonMarkConverter re-creating object each time new text is converted (#26)
- Removed HtmlRenderer::render() (use the renderBlock method instead)
- Removed dependency on symfony/options-resolver (fixes #20)
0.4.0 - 2014-12-15
- Added some missing copyright info
- Changed namespace to League\CommonMark
- Made compatible with spec version 0.13
- Moved delimiter stack functionality into separate class
- Fixed regex which caused HHVM tests to fail
0.3.0 - 2014-11-28
- Made renderer options configurable (issue #7)
- Made compatible with spec version 0.12
- Stack-based parsing now used for emphasis, links and images
- Protected some of the internal renderer methods which shouldn't have been
public
- Minor code clean-up (including PSR-2 compliance)
- Removed unnecessary distinction between ATX and Setext headers
0.2.1 - 2014-11-09
- Added simpler string replacement to a method
- Removed "is" prefix from boolean methods
- Updated to latest version of PHPUnit
- Target specific spec version
0.2.0 - 2014-11-09
- Mirrored significant changes and improvements from stmd.js
- Made compatible with spec version 0.10
- Updated location of JGM's repository
- Allowed HHVM tests to fail without affecting overall build success
- Removed composer.lock
- Removed fixed reference to jgm/stmd@0275f34
0.1.2 - 2014-09-28
- Added performance benchmarking tool (issue #2)
- Added more badges to the README
- Fix JS -> PHP null judgement (issue #4)
- Updated phpunit dependency
0.1.1 - 2014-09-08
- Add anchors to regexes
- Updated target spec (now compatible with jgm/stmd:spec.txt @ 2cf0750)
- Adjust HTML output for fenced code
- Adjust block-level tag regex (remove "br", add "iframe")
- Fix incorrect handling of nested emphasis
- Initial commit (compatible with jgm/stmd:spec.txt @ 0275f34)