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 hidden (Show)

commonmark - 2.4.2 Latest Release

Published by colinodell 9 months ago

Fixed

  • Fixed declaration parser being too strict
  • FencedCodeRenderer: don't add language- to class if already prefixed

New Contributors

Full Changelog: https://github.com/thephpleague/commonmark/compare/2.4.1...2.4.2

commonmark - 2.4.1

Published by colinodell about 1 year ago

Fixed

  • Fixed ExternalLinkProcessor not fully disabling the rel attribute when configured to do so (#992)
commonmark - 2.4.0

Published by colinodell over 1 year ago

See the upgrading guide for more information about the exception-related changes

Added

  • Added generic CommonMarkException marker interface for all exceptions thrown by the library
  • Added several new specific exception types implementing that marker interface:
    • AlreadyInitializedException
    • InvalidArgumentException
    • IOException
    • LogicException
    • MissingDependencyException
    • NoMatchingRendererException
    • ParserLogicException
  • Added more configuration options to the Heading Permalinks extension (#939):
    • heading_permalink/apply_id_to_heading - When true, the id attribute will be applied to the heading element itself instead of the <a> tag
    • heading_permalink/heading_class - class to apply to the heading element
    • heading_permalink/insert - now accepts none to prevent the creation of the <a> link
  • Added new table/alignment_attributes configuration option to control how table cell alignment is rendered (#959)

Changed

  • Change several thrown exceptions from RuntimeException to LogicException (or something extending it), including:
    • CallbackGenerators that fail to set a URL or return an expected value
    • MarkdownParser when deactivating the last block parser or attempting to get an active block parser when they've all been closed
    • Adding items to an already-initialized Environment
    • Rendering a Node when no renderer has been registered for it
  • HeadingPermalinkProcessor now throws InvalidConfigurationException instead of RuntimeException when invalid config values are given.
  • HtmlElement::setAttribute() no longer requires the second parameter for boolean attributes
  • Several small micro-optimizations
  • Changed Strikethrough to only allow 1 or 2 tildes per the updated GFM spec

Fixed

  • Fixed inaccurate @throws docblocks throughout the codebase, including ConverterInterface, MarkdownConverter, and MarkdownConverterInterface.
    • These previously suggested that only \RuntimeExceptions were thrown, which was inaccurate as \LogicExceptions were also possible.
commonmark - 2.3.9

Published by colinodell over 1 year ago

Fixed

  • Fixed autolink extension not detecting some URIs with underscores (#956)
commonmark - 2.3.8

Published by colinodell almost 2 years ago

Fixed

  • Fixed parsing issues when mb_internal_encoding() is set to something other than UTF-8 (#951)
commonmark - 2.3.7

Published by colinodell almost 2 years ago

Fixed

  • Fixed TaskListItemMarkerRenderer not including HTML attributes set on the node by other extensions (#947)
commonmark - 2.3.6

Published by colinodell almost 2 years ago

Fixed

  • Fixed unquoted attribute parsing when closing curly brace is followed by certain characters (like a .) (#943)
commonmark - 2.3.5

Published by colinodell about 2 years ago

Fixed

  • Fixed error using InlineParserEngine when no inline parsers are registered in the Environment (#908)
commonmark - 2.3.4

Published by colinodell over 2 years ago

Changed

  • Made a number of small tweaks to the embed extension's parsing behavior to fix #898:
    • Changed EmbedStartParser to always capture embed-like lines in container blocks, regardless of parent block type
    • Changed EmbedProcessor to also remove Embed blocks that aren't direct children of the Document
    • Increased the priority of EmbedProcessor to 1010

Fixed

  • Fixed EmbedExtension not parsing embeds following a list block (#898)
commonmark - 2.3.3

Published by colinodell over 2 years ago

Fixed

  • Fixed DomainFilteringAdapter not reindexing the embed list (#884, #885)
commonmark - 2.3.2

Published by colinodell over 2 years ago

Fixed

  • Fixed FootnoteExtension stripping extra characters from tab-indented footnotes (#881)
commonmark - 2.2.5

Published by colinodell over 2 years ago

Fixed

  • Fixed FootnoteExtension stripping extra characters from tab-indented footnotes (#881)
commonmark - 2.3.1

Published by colinodell over 2 years ago

Fixed

  • Fixed AutolinkExtension not ignoring trailing strikethrough syntax (#867)
commonmark - 2.2.4

Published by colinodell over 2 years ago

Fixed

  • Fixed AutolinkExtension not ignoring trailing strikethrough syntax (#867)
commonmark - 2.3.0

Published by colinodell over 2 years ago

Added

  • Added new EmbedExtension (#805)
  • Added DocumentRendererInterface as a replacement for the now-deprecated MarkdownRendererInterface

Deprecated

  • Deprecated MarkdownRendererInterface; use DocumentRendererInterface instead
commonmark - 2.2.3

Published by colinodell over 2 years ago

Fixed

  • Fixed front matter parsing with Windows line endings (#821)
commonmark - 2.1.3

Published by colinodell over 2 years ago

Fixed

  • Fixed front matter parsing with Windows line endings (#821)
commonmark - 2.0.4

Published by colinodell over 2 years ago

Fixed

  • Fixed front matter parsing with Windows line endings (#821)
commonmark - 2.2.2

Published by colinodell over 2 years ago

Fixed

  • Fixed double-escaping of image alt text (#806, #810)
  • Fixed Psalm typehints for event class names
commonmark - 2.1.2

Published by colinodell over 2 years ago

Fixed

  • Fixed double-escaping of image alt text (#806, #810)
  • Fixed Psalm typehints for event class names
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