mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-12-04 14:53:37 +08:00
28c706fee3
Needed to tweak the default library strikethrough extension so that it uses the same element as front-end. Added testing to cover. For #2470.
16 lines
640 B
PHP
16 lines
640 B
PHP
<?php namespace BookStack\Entities\Tools\Markdown;
|
|
|
|
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());
|
|
}
|
|
} |