league/commonmark
Highly extensible PHP Markdown parser supporting full CommonMark and GitHub-Flavored Markdown. Convert Markdown to HTML with simple converters, customize rendering via extensions, and run safely with options like stripping HTML and blocking unsafe links.
layout: default title: Overview redirect_from:
{{ site.data.project.highlights.description }}
This library can be installed via Composer:
composer require league/commonmark
See the installation section for more details.
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.
How can I help you explore Laravel packages today?