mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-12-13 14:33:37 +08:00
18 lines
643 B
PHP
18 lines
643 B
PHP
<?php
|
|
|
|
namespace BookStack\Entities\Tools\Markdown;
|
|
|
|
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
|
|
{
|
|
public function register(EnvironmentBuilderInterface $environment): void
|
|
{
|
|
$environment->addDelimiterProcessor(new StrikethroughDelimiterProcessor());
|
|
$environment->addRenderer(Strikethrough::class, new CustomStrikethroughRenderer());
|
|
}
|
|
}
|