for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the league/commonmark-ext-strikethrough package.
*
* (c) Colin O'Dell <[email protected]> and uAfrica.com (http://uafrica.com)
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace League\CommonMark\Ext\Strikethrough;
use League\CommonMark\ElementRendererInterface;
use League\CommonMark\HtmlElement;
use League\CommonMark\Inline\Element\AbstractInline;
use League\CommonMark\Inline\Renderer\InlineRendererInterface;
use League\CommonMark\Util\Xml;
final class StrikethroughRenderer implements InlineRendererInterface
{
/**
* {@inheritdoc}
public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer)
if (!($inline instanceof Strikethrough)) {
throw new \InvalidArgumentException('Incompatible inline type: ' . get_class($inline));
}
return new HtmlElement('del', $inline->getData('attributes', []), Xml::escape($inline->getContent()));