Skip to content

Releases: thephpleague/commonmark

0.11.3

25 Sep 12:40
Compare
Choose a tag to compare

Fixed

0.11.2

23 Sep 14:07
Compare
Choose a tag to compare

Fixed

  • Fixed parser checking acceptsLines on the wrong element (#183)

0.11.1

22 Sep 12:06
Compare
Choose a tag to compare

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

19 Sep 15:15
Compare
Choose a tag to compare

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 both AbstractBlock and AbstractInline extend from (#169)
  • Added a NodeWalker and NodeWalkerEvent to traverse the AST without using recursion
  • Added new InlineContainer interface for blocks
  • Added new getContainer() and getReferenceMap() methods to InlineParserContext
  • 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 and AbstractInline both extend from Node
    • Sub-classes must implement new isContainer() method
  • Other major changes to AbstractBlock:
    • getParent() is now parent()
    • setParent() now expects a Node instead of an AbstractBlock
    • getChildren() is now children()
    • getLastChild() is now lastChild()
    • addChild() is now appendChild()
  • InlineParserContext is constructed using the container AbstractBlock and the document's RefereceMap
    • The constructor will automatically create the Cursor using the container's string contents
  • InlineParserEngine::parse now requires the Node container and the document's ReferenceMap instead of a ContextInterface and Cursor
  • Changed Delimiter to reference the actual inline Node instead of the position
    • The int $pos protected member and constructor arg is now Node $node
    • Use getInlineNode() and setInlineNode() instead of getPos() and setPos()
  • Changed DocParser::processInlines to use a NodeWalker to iterate through inlines
    • Walker passed as second argument instead of AbstractBlock
    • Uses a while loop instead of recursion to traverse the AST
  • Image and Link 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 new DocParser::setAndPropagateLastLineBlank() method
    • AbstractBlock::setLastLineBlank() is now a setter method for AbstractBlock::$lastLineBlank
  • 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 implement InlineContainer instead
    • Use child methods instead of getInlines and setInlines
  • Removed AbstractBlock::replaceChild()
    • Call Node::replaceWith() directly the child node instead
  • Removed the getInlines() method from InlineParserContext
    • Add parsed inlines using $inlineContext->getContainer()->appendChild() instead of $inlineContext->getInlines()->add()
  • Removed the ContextInterface argument from AbstractInlineParser::parse() and InlineParserEngine::parseCharacter
  • Removed the first ArrayCollection $inlines argument from InlineProcessorInterface::processInlines()
  • Removed CloseBracketParser::nullify()
  • Removed pre from rule 6 of HTML blocks (see commonmark/commonmark-spec#355)

0.10.0

25 Jul 14:37
Compare
Choose a tag to compare

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 with ElementRendererInterface (#141)
  • Removed the unnecessary trim() and string cast from ListItemRenderer

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

19 Jun 00:41
Compare
Choose a tag to compare

Added

  • Added public $data array to block elements (#95)
  • Added isIndented helper method to Cursor
  • Added a new Converter base class which CommonMarkConverter extends from (#105)

Changed

Fixed

0.8.0

29 Apr 18:02
Compare
Choose a tag to compare

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

Removed

  • 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

08 Mar 17:54
Compare
Choose a tag to compare

Changed

  • Bumped spec target version to 0.18

Fixed

  • Fixed broken parsing of emphasized text ending with a '0' character (#81)

0.7.1

01 Mar 21:29
Compare
Choose a tag to compare

Added

  • All references can now be obtained from the ReferenceMap via listReferences() (#73)
  • Test against PHP 7.0 (nightly) but allow failures

Changed

  • ListData::$start now defaults to null instead of 0 (#74)
  • Replace references to HtmlRenderer with new HtmlRendererInterface

Fixed

  • Fixed 0-based ordered lists starting at 1 instead of 0 (#74)
  • Fixed errors parsing multi-byte characters (#78 and #79)

0.7.0

17 Feb 00:02
Compare
Choose a tag to compare

Now with 50% more speed!

Added

  • More unit tests to increase code coverage

Changed

  • 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

  • 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