This is the documentation for the unsupported version 0.19. Please consider upgrading your code to the latest stable version


Author Latest Version Total Downloads Software License Build Status Coverage Status Quality Score

The PHP CommonMark parser is a robust, highly-extensible Markdown parser for PHP based on the CommonMark and Github-Flavored Markdown specifications.


This library can be installed via Composer:

composer require league/commonmark:^0.19

See the installation section for more details.

Basic Usage

Simply instantiate the converter and start converting some Markdown to HTML!


use League\CommonMark\CommonMarkConverter;

$converter = new CommonMarkConverter();
echo $converter->convertToHtml('# Hello World!');

// <h1>Hello World!</h1>

Important: See the basic usage and security sections for important details.