X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/a6633642232efd164d4708967ab59e498fbff896..refs/pull/5313/head:/app/Entities/Tools/Markdown/CustomStrikethroughRenderer.php diff --git a/app/Entities/Tools/Markdown/CustomStrikethroughRenderer.php b/app/Entities/Tools/Markdown/CustomStrikethroughRenderer.php index 4371fb84c..01b09377b 100644 --- a/app/Entities/Tools/Markdown/CustomStrikethroughRenderer.php +++ b/app/Entities/Tools/Markdown/CustomStrikethroughRenderer.php @@ -1,24 +1,24 @@ - HTML tags instead of in order to * match front-end markdown-it rendering. */ -class CustomStrikethroughRenderer implements InlineRendererInterface +class CustomStrikethroughRenderer implements NodeRendererInterface { - public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer) + public function render(Node $node, ChildNodeRendererInterface $childRenderer) { - if (!($inline instanceof Strikethrough)) { - throw new \InvalidArgumentException('Incompatible inline type: ' . get_class($inline)); - } + Strikethrough::assertInstanceOf($node); - return new HtmlElement('s', $inline->getData('attributes', []), $htmlRenderer->renderInlines($inline->children())); + return new HtmlElement('s', $node->data->get('attributes'), $childRenderer->renderNodes($node->children())); } -} \ No newline at end of file +}