

league/commonmark 1.0.0 has been released! | Colin O'Dell
source link: https://www.colinodell.com/blog/201906/leaguecommonmark-100-has-been-released
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

After 5 years of development, 3,000,000 downloads, and 58 releases, I'm extremely pleased to announce that league/commonmark version 1.0.0 has been released!
What is league/commonmark
?
league/commonmark
is a highly-extensible PHP Markdown parser which is fully compliant with the CommonMark spec. It avoids some of the issues and funky edge cases that other Markdown parsers have while also allowing you to implement your own custom Markdown syntax to best suit your needs.
Why did this take so long?
The very first commit to this project was made almost 5 years ago, shortly after the CommonMark initiative was announced. Since then, the spec has undergone 29 major (0.x
) revisions - many of which fundamentally changed how certain types of syntax are handled. This was especially true in the early days of the spec as serious issues were identified and ironed out.
Because the spec was largely unstable and subject to major changes, I originally planned to wait until the spec reached 1.0
stability before releasing 1.0.0 of this library. This wait ended up being longer than I expected.
There are still some unresolved issues with the CommonMark spec that need to be addressed before they release 1.0. Some of these will certainly change how certain Markdown inputs are handled. However, over the past several years, we've seen the core parsing logic gradually stabilize with each new release. So while I can't predict what changes might come in the future, I do feel fairly confident that our library's public API is unlikely to change much at this point.
Why didn't you wait longer?
This library has gone through 19 different 0.x
releases over the years with each one introducing some breaking changes. This made it harder for extensions and end-users to stay up-to-date. Many of these changes were required to keep up with the underlying spec's changes (remember, they went through 29 0.x
releases) while others were simply improvements on our own code base.
Because development of the spec has slowed down, and most of the important logic is unlikely to change much, I felt like now was a good time to put forth a stable release.
What does this mean for stability?
Three things:
-
We'll be staying on the
1.x
branch for a while. I'm quite pleased with the improvements we've made to the code architecture and it should hopefully serve us well for a long time to come. - More minor updates == fewer breaking changes. It'll be even easier to keep your sites and applications up-to-date with the latest fixes and improvements.
- Guaranteed support periods for older releases. Each new major and minor version will remain supported for several months.
What else is in 1.0.0
?
In a nutshell, we've made the following changes since 0.19
:
- Custom delimiters are much easier to add thanks to a major overhaul of the delimiter system
- An event dispatcher is now available, making it easier to hook into certain functionality without needing to extend or replace classes
- Most of the core classes now use interfaces, allowing you to easily swap out components or mock them in your tests
- Legacy cruft has been cleaned up
See our upgrading guide and https://commonmark.thephpleague.com/1.0/changelog/ for more information.
Awesome! How can I get it?
Simply bump your Composer version constraints to ^1.0
!
And if you don't already have the library installed, simply run composer install league/commonmark
and follow the basic usage documentation to get started!
Recommend
-
134
Psst - PHP 7.4 is now available! Learn how to upgrade to PHP 7.4 here! PHP 7.2 ha...
-
68
Post with 0 votes and 3296 views. We've all been there
-
41
The CommonMark-compliant markdown parser and renderer in Go, and the infrastructure. This organization has moved to https://gitlab.com/golang-commonmark - golang-commonmark
-
41
PHP 7.3 has been released, bringing some great new features to the language such as trailing commas in function calls, throwing errors when JSON parsing fails, array_key_first() / array_key_last() functions, and much more!
-
71
goldmark A markdown parser written in Go. Easy to extend, standard compliant, well structured. goldmark is compliant to CommonMark 0.29. Motivation I need a markdown parser for...
-
251
README.md goldmark
-
23
Try the jc web demo! I’m happy to announce that jc version 1.7.1 has been released and is available on
-
32
league/commonmark 1.3.0 Adds Full GFM Support!
-
22
Highlight code blocks with league/commonmark and Shiki This package contains a block renderer for league/commonmark to highlight code blocks using
-
5
Render Markdown AST back to Markdown. Render a league/commonmark AST back to Markdown. Note: Markdown knows alternate syntaxes for the same elements (heading, emphasis, unordered lists, horizontal rules). Ther...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK