Overview
The PHP CommonMark
parser is a robust, highly-extensible Markdown parser for PHP based on the CommonMark and GitHub-Flavored Markdown specifications.
Installation
This library can be installed via Composer:
composer require league/commonmark
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->convert('# Hello, World!')->getContent();
// <h1>Hello, World!</h1>
Important: See the basic usage and security sections for important details.