PHP code example of submitty / markdown
1. Go to this page and download the library: Download submitty/markdown library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
submitty / markdown example snippets
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));