The only PHP library fully compatible with the CommonMark and Github-Flavored Markdown specs
Highly extensible architecture supports custom syntax and other customizations
Community extensions and integrations for popular frameworks and CMSes
use League\CommonMark\CommonMarkConverter; $converter = new CommonMarkConverter(); echo $converter->convertToHtml('# Hello World!'); // <h1>Hello World!</h1>
All CommonMark features are supported by default, including raw HTML and unsafe links, which you may want to disable using the
use League\CommonMark\CommonMarkConverter; $converter = new CommonMarkConverter(['html_input' => 'escape', 'allow_unsafe_links' => false]); echo $converter->convertToHtml('# Hello World!'); // <h1>Hello World!</h1>
This project includes several built-in extensions you can use to enable additional features and syntax.
This library allows you to add custom syntax, renderers, and more. Check out the Customization section for more information.
Community Integrations & Extensions
An updated list of pre-built integrations and extensions can be found in the Related Packages section of the
We'd like to extend our sincere thanks the following sponsors who support ongoing development of this project:
- Tidelift for offering support to both the maintainers and end-users through their professional support program
- JetBrains for supporting this project with complimentary PhpStorm licenses
Are you interested in sponsoring development of this project?
See https://www.colinodell.com/sponsor for a list of ways to contribute!