2021-06-26 23:23:15 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\Entities\Tools\Markdown;
|
2021-01-11 07:01:11 +08:00
|
|
|
|
|
|
|
use League\CommonMark\ConfigurableEnvironmentInterface;
|
|
|
|
use League\CommonMark\Extension\ExtensionInterface;
|
|
|
|
use League\CommonMark\Extension\Strikethrough\Strikethrough;
|
|
|
|
use League\CommonMark\Extension\Strikethrough\StrikethroughDelimiterProcessor;
|
|
|
|
|
|
|
|
class CustomStrikeThroughExtension implements ExtensionInterface
|
|
|
|
{
|
|
|
|
public function register(ConfigurableEnvironmentInterface $environment)
|
|
|
|
{
|
|
|
|
$environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor());
|
|
|
|
$environment->addInlineRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
|
|
|
|
}
|
2021-03-08 06:24:05 +08:00
|
|
|
}
|