BookStack/app/Entities/Tools/Markdown/CustomStrikeThroughExtension.php

18 lines
643 B
PHP
Raw Normal View History

2021-06-26 15:23:15 +00:00
<?php
namespace BookStack\Entities\Tools\Markdown;
2023-02-06 20:00:44 +00:00
use League\CommonMark\Environment\EnvironmentBuilderInterface;
use League\CommonMark\Extension\ExtensionInterface;
use League\CommonMark\Extension\Strikethrough\Strikethrough;
use League\CommonMark\Extension\Strikethrough\StrikethroughDelimiterProcessor;
class CustomStrikeThroughExtension implements ExtensionInterface
{
2023-02-06 20:00:44 +00:00
public function register(EnvironmentBuilderInterface $environment): void
{
$environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor());
2023-02-06 20:00:44 +00:00
$environment->addRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
}
2021-03-07 22:24:05 +00:00
}