parent = new \League\CommonMark\Inline\Renderer\ImageRenderer(); } /** * @param Image $inline * * @return HtmlElement */ public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer) { if (!($inline instanceof Image)) { throw new \InvalidArgumentException('Incompatible inline type: ' . get_class($inline)); } // External Images need special handling if (strpos($inline->getUrl(), 'http') === 0) { return new HtmlElement( 'ac:image', [], new HtmlElement('ri:url', ['ri:value' => $inline->getUrl()]) ); } return $this->parent->render($inline, $htmlRenderer); } public function setConfiguration(ConfigurationInterface $configuration) { $this->parent->setConfiguration($configuration); } }