Twig-Markdown Extension
Forked from aptoma/twig-markdown
To report issues for Submitty/Markdown, please file them under the Submitty/Submitty repository.
- Apply league/commonmark as an Twig Extension
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/Submitty/Markdown.git"
}
],
"require":{
"league/commonmark": "2.4.0",
"submitty/markdown": "version"
}
}
composer install
# or
composer update
use League\CommonMark\MarkdownConverter;
use Markdown\twig\Extension\PHPLeagueMarkdownEngine;
use Markdown\twig\Extension\MarkdownExtension;
// Based on the league/commonmark example
$config = [
'allow_unsafe_links' => false,
];
$environment = new Environment($config);
$environment->addExtension(new CommonMarkCoreExtension());
$converter = new MarkdownConverter($environment);
$engine = new PHPLeagueMarkdownEngine($converter);
twig->addExtension(new MarkdownExtension($engine));
Documentation in Progress General Documentation