. */ namespace Fisharebest\Webtrees\CommonMark; use Fisharebest\Webtrees\Tree; use League\CommonMark\Extension\Extension; /** * Convert XREFs within markdown text to links */ class XrefExtension extends Extension { /** @var Tree - match XREFs in this tree */ private $tree; /** * MarkdownXrefParser constructor. * * @param Tree $tree */ public function __construct(Tree $tree) { $this->tree = $tree; } /** * @return array */ public function getInlineParsers() { return [ new XrefParser($this->tree), ]; } /** * @return string */ public function getName() { return 'xref'; } }