for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace League\CommonMark\Extras\StrikeThrough;
use League\CommonMark\ElementRendererInterface;
use League\CommonMark\HtmlElement;
use League\CommonMark\Inline\Element\AbstractInline;
use League\CommonMark\Inline\Renderer\InlineRendererInterface;
class StrikeThroughRenderer implements InlineRendererInterface {
public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer)
{
if (!($inline instanceof StrikethroughElement)) {
throw new \InvalidArgumentException('Incompatible inline type: ' . get_class($inline));
}
$attrs = [];
foreach ($inline->getData('attributes', []) as $key => $value) {
$attrs[$key] = $value;
return new HtmlElement('del', $attrs, $inline->getContent());