commonmark

Highly-extensible PHP Markdown parser which fully supports the CommonMark and GFM specs.

BSD-3-CLAUSE License

Downloads
256.3M
Stars
2.7K
Committers
117

Bot releases are visible (Hide)

commonmark - 1.6.0

Published by colinodell over 3 years ago

Please see https://commonmark.thephpleague.com/1.6/upgrading/ for important information about this release and the upcoming 2.0.0 version.

Added

  • Added forward-compatibility for configuration options which will be changing in 2.0:
    • commonmark/enable_em (currently enable_em in 1.x)
    • commonmark/enable_strong (currently enable_strong in 1.x)
    • commonmark/use_asterisk (currently use_asterisk in 1.x)
    • commonmark/use_underscore (currently use_underscore in 1.x)
    • commonmark/unordered_list_markers (currently unordered_list_markers in 1.x)
    • mentions/*/prefix (currently mentions/*/symbol in 1.x)
    • mentions/*/pattern (currently mentions/*/regex in 1.x)
    • max_nesting_level (currently supports int and float values in 1.x; will only support int in 2.0)
  • Added new MarkdownConverter class for creating converters with custom environments; this replaces the previously-deprecated Converter class
  • Added new RegexHelper::matchFirst() method
  • Added new Configuration::exists() method

Changed

  • The max_nesting_level option now defaults to PHP_INT_MAX instead of INF

Deprecated

  • Deprecated the configuration options shown above
  • Deprecated the ability to pass a custom Environment into the constructors of CommonMarkConverter and GithubFlavoredMarkdownConverter; use MarkdownConverter instead
  • Deprecated ConfigurableEnvironmentInterface::setConfig(); use mergeConfig() instead
  • Deprecated calling ConfigurableEnvironmentInterface::mergeConfig() without any parameters
  • Deprecated calling Configuration::get() and EnvironmentInterface::getConfig() without any parameters
  • Deprecated calling Configuration::set() without the second $value parameter
  • Deprecated RegexHelper::matchAll(); use RegexHelper::matchFirst() instead
  • Deprecated extending the ArrayCollection class; will be marked final in 2.0

Fixed

  • Fixed missing check for empty arrays being passed into the unordered_list_markers configuration option
commonmark - 1.5.8

Published by colinodell over 3 years ago

Fixed

  • Fixed Table of Contents not rendering heading inlines properly (#587, #588)
  • Fixed parsing of tables within list items (#590)
commonmark - 1.5.7

Published by colinodell almost 4 years ago

Fixed

  • Fixed mentions not being parsed when appearing after non-word characters (#582)
commonmark - 1.5.6

Published by colinodell about 4 years ago

Changed

  • Blocks added outside of the parsing context now have their start/end line numbers defaulted to 0 to avoid type errors (#579)

Fixed

  • Fixed replacement blocks not inheriting the start line number of the container they're replacing (#579)
  • Fixed Table of Contents blocks not having correct start/end line numbers (#579)
commonmark - 1.5.5

Published by colinodell about 4 years ago

Changed

  • Bumped CommonMark spec compliance to 0.28.2

Fixed

  • Fixed textarea elements not being treated as a type 1 HTML block (like script, style, or pre)
  • Fixed autolink processor not handling other unmatched trailing parentheses
commonmark - 1.5.4

Published by colinodell about 4 years ago

Fixed

  • Fixed footnote ID configuration not taking effect (#524, #530)
  • Fixed heading permalink slugs not being unique (#531, #534)
commonmark - 1.5.3

Published by colinodell over 4 years ago

Fixed

  • Fixed regression of multi-byte inline parser characters not being matched
commonmark - 1.5.2

Published by colinodell over 4 years ago

Changed

  • Significantly improved performance of the inline parser regex

Fixed

  • Fixed parent class lookups for non-existent classes on PHP 8 (#517)
commonmark - 1.5.1

Published by colinodell over 4 years ago

Fixed

  • Fixed UTF-8 encoding not being checked in the UrlEncoder utility (#509) or the Cursor
commonmark - 1.5.0

Published by colinodell over 4 years ago

Added

  • Added new AttributesExtension based on https://github.com/webuni/commonmark-attributes-extension (#474)
  • Added new FootnoteExtension based on https://github.com/rezozero/commonmark-ext-footnotes (#474)
  • Added new MentionExtension to replace InlineMentionParser with more flexibility and customization
  • Added the ability to render TableOfContents nodes anywhere in a document (given by a placeholder)
  • Added the ability to properly clone Node objects
  • Added options to customize the value of rel attributes set via the ExternalLink extension (#476)
  • Added a new heading_permalink/slug_normalizer configuration option to allow custom slug generation (#460)
  • Added a new heading_permalink/symbol configuration option to replace the now deprecated heading_permalink/inner_contents configuration option (#505)
  • Added SlugNormalizer and TextNormalizer classes to make normalization reusable by extensions (#485)
  • Added new classes:
    • TableOfContentsGenerator
    • TableOfContentsGeneratorInterface
    • TableOfContentsPlaceholder
    • TableOfContentsPlaceholderParser
    • TableOfContentsPlaceholderRenderer

Changed

  • "Moved" the TableOfContents class into a new Node sub-namespace (with backward-compatibility)
  • Reference labels are now generated and stored in lower-case instead of upper-case
  • Reference labels are no longer normalized inside the Reference, only the ReferenceMap

Fixed

  • Fixed reference label case folding polyfill not being consistent between different PHP versions

Deprecated

  • Deprecated the CommonMarkConverter::VERSION constant (#496)
  • Deprecated League\CommonMark\Extension\Autolink\InlineMentionParser (use League\CommonMark\Extension\Mention\MentionParser instead)
  • Deprecated everything under League\CommonMark\Extension\HeadingPermalink\Slug (use the classes under League\CommonMark\Normalizer instead)
  • Deprecated League\CommonMark\Extension\TableOfContents\TableOfContents (use the one in the new Node sub-namespace instead)
  • Deprecated the STYLE_ and NORMALIZE_ constants in TableOfContentsBuilder (use the ones in TableOfContentsGenerator instead)
  • Deprecated the \League\CommonMark\Extension\HeadingPermalink\HeadingPermalinkRenderer::DEFAULT_INNER_CONTENTS constant (#505)
  • Deprecated the heading_permalink/inner_contents configuration option in the HeadingPermalink extension (use the new heading_permalink/symbol configuration option instead) (#505)
commonmark - 1.4.3

Published by colinodell over 4 years ago

Fixed

  • Fixed certain Unicode letters, numbers, and marks not being preserved when generating URL slugs (#467)
commonmark - 1.4.2

Published by colinodell over 4 years ago

Fixed

  • Fixed inline code blocks not be included within heading permalinks (#457)
commonmark - 1.4.1

Published by colinodell over 4 years ago

Fixed

  • Fixed BC break caused by ConverterInterface alias not being used by some DI containers (#454)
commonmark - 1.4.0

Published by colinodell over 4 years ago

Added

  • Added new Heading Permalink extension (#420)
  • Added new Table of Contents extension (#441)
  • Added new MarkdownConverterInterface as a long-term replacement for ConverterInterface (#439)
  • Added new DocumentPreParsedEvent event (#427, #359, #399)
  • Added new ListBlock::TYPE_BULLET constant as a replacement for ListBlock::TYPE_UNORDERED
  • Added new MarkdownInput class and MarkdownInputInterface to handle pre-parsing and allow listeners to replace Markdown contents

Changed

  • Block & inline renderers will now render child classes automatically (#222, #209)
  • The ListBlock constants now use fully-lowercased values instead of titlecased values
  • Significantly improved typing

Fixed

  • Fixed loose comparison when checking for table alignment
  • Fixed StaggeredDelimiterProcessor returning from a void function

Deprecated

  • The Converter class has been deprecated; use CommonMarkConverter instead (#438, #439)
  • The ConverterInterface has been deprecated; use MarkdownConverterInterface instead (#438, #439)
  • The bin/commonmark script has been deprecated
  • The following methods of ArrayCollection have been deprecated:
    • add()
    • set()
    • get()
    • remove()
    • isEmpty()
    • contains()
    • indexOf()
    • containsKey()
    • replaceWith()
    • removeGaps()
  • The ListBlock::TYPE_UNORDERED constant has been deprecated, use ListBlock::TYPE_BULLET instead
commonmark - 1.3.4

Published by colinodell over 4 years ago

Fixed

  • Fixed configuration/environment not being injected into event listeners when adding them via [$instance, 'method'] callable syntax (#440)
commonmark - 1.3.3

Published by colinodell over 4 years ago

Fixed

  • Fixed event listeners not having the environment or configuration injected if they implemented the EnvironmentAwareInterface or ConfigurationAwareInterface (#423)
commonmark - 1.3.2

Published by colinodell over 4 years ago

Fixed

  • Optimized URL normalization in cases where URLs don't contain special characters (#417, #418)
commonmark - 1.3.1

Published by colinodell over 4 years ago

Fixed

  • Fixed return types of Environment::createCommonMarkEnvironment() and Environment::createGFMEnvironment()
commonmark - 1.3.0

Published by colinodell over 4 years ago

ℹī¸ Do you use league/commonmark-ext* packages? Those features are now included directly in this library! See #409 for details on making the switch.

Added

  • Added (optional) full GFM support! 🎉🎉🎉 (#409)
  • Added check to ensure Markdown input is valid UTF-8 (#401, #405)
  • Added new unordered_list_markers configuration option (#408, #411)

Changed

  • Introduced several micro-optimizations for a 5-10% performance boost
commonmark - 1.2.2

Published by colinodell almost 5 years ago

This release contains the same changes as 1.1.3:

Fixed

  • Fixed link parsing edge case (#403)
Package Rankings
Top 0.11% on Packagist.org
Badges
Extracted from project README
Latest Version Total Downloads Software License Build Status Coverage Status Quality Score Psalm Type Coverage CII Best Practices Sponsor development of this project
Related Projects