. */ declare(strict_types=1); namespace Fisharebest\Webtrees\CommonMark; use League\CommonMark\ElementRendererInterface; use League\CommonMark\Inline\Element\AbstractInline; use League\CommonMark\Inline\Renderer\InlineRendererInterface; use function e; /** * Convert XREFs within markdown text to links */ class XrefRenderer implements InlineRendererInterface { /** * @param AbstractInline $inline * @param ElementRendererInterface $htmlRenderer * * @return string */ public function render(AbstractInline $inline, ElementRendererInterface $htmlRenderer): string { assert($inline instanceof XrefNode); return '' . $inline->record()->fullName() . ''; } }