Create a ready to use handler to render markdown

parent 576d6ee7
<?php
namespace Modules\Core\Events\Handlers;
use League\CommonMark\CommonMarkConverter;
use Modules\Page\Events\ContentIsRendering;
class RenderMarkdown
{
public function handle(ContentIsRendering $event)
{
$converter = new CommonMarkConverter();
$html = $converter->convertToHtml($event->getOriginal());
$event->setBody($html);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment