packagist league/commonmark 1.0.0-beta1

latest releases: 2.8.0, 2.7.1, 2.7.0...
6 years ago

See the upgrading guide for additional information.

Added

  • Added proper support for delimiters, including custom delimiters
    • addDelimiterProcessor() added to ConfigurableEnvironmentInterface and Environment
  • 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 from DocParser
    • ConfigurationInterface created from Configuration
    • ReferenceInterface created from Reference

Changed

  • Renamed several methods of the Configuration class:
    • getConfig() renamed to get()
    • mergeConfig() renamed to merge()
    • setConfig() renamed to replace()
  • Changed ConfigurationAwareInterface::setConfiguration() to accept the new ConfigurationInterface instead of the concrete class
  • Renamed the AdjoiningTextCollapser class to AdjacentTextMerger
    • Replaced its collapseTextNodes() method with the new mergeChildNodes() method
  • 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 in InlineParserEngine
  • Marked some classes and methods as @internal
  • ElementRendererInterface now requires a public renderInline() method; added this to HtmlRenderer
  • Changed InlineParserEngine::parse() to require an AbstractStringContainerBlock instead of the generic Node class
  • Un-deprecated the CommonmarkConverter::VERSION constant
  • The Converter constructor now requires an instance of DocParserInterface instead of the concrete DocParser
  • Changed Emphasis, Strong, and AbstractWebResource to directly extend AbstractInline instead of the (now-deprecated) intermediary AbstractInlineContainer class

Fixed

  • Fixed null errors when inserting sibling Nodes without parents
  • Fixed NodeWalkerEvent not requiring a Node 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 to false (it now works identically to enable_em)

Deprecated

  • Deprecated DocParser::getEnvironment() (you should obtain it some other way)
  • Deprecated AbstractInlineContainer (use AbstractInline instead and make isContainer() return true)

Removed

  • Removed inline processor functionality now that we have proper delimiter support:
    • Removed addInlineProcessor() from ConfigurableEnvironmentInterface and Environment
    • Removed getInlineProcessors() from EnvironmentInterface and Environment
    • Removed EmphasisProcessor
    • Removed InlineProcessorInterface
  • Removed EmphasisParser now that we have proper delimiter support
  • Removed support for non-UTF-8-compatible encodings
    • Removed getEncoding() from ContextInterface
    • Removed getEncoding(), setEncoding(), and $encoding from Context
    • Removed getEncoding() and the second $encoding constructor param from Cursor
  • Removed now-unused methods
    • Removed DelimiterStack::getTop() (no replacement)
    • Removed DelimiterStack::iterateByCharacters() (use the new processDelimiters() method instead)
    • Removed the protected DelimiterStack::findMatchingOpener() method

Don't miss a new commonmark release

NewReleases is sending notifications on new releases.