New Release: league/commonmark 1.5.0

league/commonmark 1.5.0 release

Version 1.5.0 of the league/commonmark Markdown library has just been released!

This will likely be the last minor release of 1.x as we focus efforts on developing 2.0. This post breaks down some of the new features and changes you should know about 1.5.0.

Three New Extensions

The popular Markdown library now includes three more extensions within core thanks for to the community:

  • Attributes - allows custom HTML attributes like id or class to be added to any element from within your Markdown.
  • Footnotes - adds the ability to create footnotes in Markdown documents with links and backreferences automatically added for you.
  • Mentions - makes it easy to parse shortened mentions and references like @colinodell to a Twitter URL or #123 to a GitHub issue URL. Creating custom mention parsers can be done 100% through configuration, too!

Improved Documentation

The full list of included extensions was also revamped, making it easier to browse and enable these features in your projects.

Switching between different versions within the documentation site will also keep you on that same topic, making it easier than ever to browse the docs.

Some code examples have also been improved.

Changes

The Heading Permalink functionality used to inject SVG icons directly into HTML - this behavior has been changed to instead insert a symbol by default, making it easier to replace this with a custom icon using CSS. This change does not affect anyone explicitly defining the inner_contents configuration option. More information on styling these links with icons can be found in the documentation.

Also, the Reference objects no longer auto-normalize themselves - the ReferenceMap now has full responsibility for this. This change should not affect anyone who doesn't directly use those classes in custom code.

More Details

As always, check out the changelog and upgrade guide for more information on leveraging the new version.

Supporting Development

You can now sponsor me on GitHub to support my open-source development and contributions! All contributions will be matched by GitHub.

❤️ Become a Sponsor

About Colin O'Dell

Colin O'Dell

Colin O'Dell is the Director of Technology at Unleashed Technologies, a web and hosting firm based in Maryland. In addition to being an active member of the PHP League and maintainer of the league/commonmark project, Colin is also a PHP docs contributor, conference speaker, and author of the PHP 7 Migration Guide.