@ -8,6 +8,7 @@ use League\CommonMark\Environment\Environment;
use HtmlSanitizer\Extension\Basic\BasicExtension;
use HtmlSanitizer\Extension\Listing\ListExtension;
use HtmlSanitizer\Extension\Iframe\IframeExtension;
use League\CommonMark\Extension\Table\TableExtension;
use League\CommonMark\Extension\Attributes\AttributesExtension;
use League\CommonMark\Extension\FrontMatter\FrontMatterExtension;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
@ -18,8 +19,7 @@ use function _\orderBy;
class Contents
{
public $files = [];
public $files = [];
public $config = [];
public function __construct($folder)
@ -54,6 +54,9 @@ class Contents
//add attributes to elements in markdown
$environment->addExtension(new AttributesExtension());
//add table rendering
$environment->addExtension(new TableExtension());
// Instantiate the converter engine and start converting some Markdown!
$converter = new MarkdownConverter($environment);
@ -78,6 +81,8 @@ class Contents
$builder->registerExtension(new BasicExtension());
$builder->registerExtension(new IframeExtension());
$builder->registerExtension(new ListExtension());
//just add it straight because classname is already in use
$builder->registerExtension(new \HtmlSanitizer\Extension\Table\TableExtension());
//relative-a and relative-image
$builder->registerExtension(
@ -88,7 +93,7 @@ class Contents
);
$detergent = [
'extensions' => ['basic', 'list', 'relative-a', 'relative-image', 'iframe'],
'extensions' => ['basic', 'list', 'relative-a', 'relative-image', 'iframe', 'table' ],
'tags' => [
'div' => [
'allowed_attributes' => ['class', 'title', 'id', 'style'],