summaryrefslogtreecommitdiff
path: root/app/CommonMark/XrefExtension.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2019-07-15 11:08:16 +0100
committerGreg Roach <fisharebest@webtrees.net>2019-07-16 10:52:40 +0100
commit4a1f1d433794f86f893b59883147e57af4e94374 (patch)
tree5cb9572b1be24c130a5b8a86b0e1672f822cdfc4 /app/CommonMark/XrefExtension.php
parent22cfa91cf34e9677c2d99c712c2fc9e1c2c8f741 (diff)
downloadwebtrees-4a1f1d433794f86f893b59883147e57af4e94374.tar.gz
webtrees-4a1f1d433794f86f893b59883147e57af4e94374.tar.bz2
webtrees-4a1f1d433794f86f893b59883147e57af4e94374.zip
Package webuni/commonmark-table-extension is abandoned, you should avoid using it. Use league/commonmark-ext-table instead.
Diffstat (limited to 'app/CommonMark/XrefExtension.php')
-rw-r--r--app/CommonMark/XrefExtension.php22
1 files changed, 6 insertions, 16 deletions
diff --git a/app/CommonMark/XrefExtension.php b/app/CommonMark/XrefExtension.php
index 2fe79f3e53..1e7ced6803 100644
--- a/app/CommonMark/XrefExtension.php
+++ b/app/CommonMark/XrefExtension.php
@@ -18,13 +18,15 @@ declare(strict_types=1);
namespace Fisharebest\Webtrees\CommonMark;
use Fisharebest\Webtrees\Tree;
+use League\CommonMark\ConfigurableEnvironmentInterface;
use League\CommonMark\Extension\Extension;
+use League\CommonMark\Extension\ExtensionInterface;
use League\CommonMark\Inline\Parser\InlineParserInterface;
/**
* Convert XREFs within markdown text to links
*/
-class XrefExtension extends Extension
+class XrefExtension implements ExtensionInterface
{
/** @var Tree - match XREFs in this tree */
private $tree;
@@ -39,21 +41,9 @@ class XrefExtension extends Extension
$this->tree = $tree;
}
- /**
- * @return InlineParserInterface[]
- */
- public function getInlineParsers(): array
- {
- return [
- new XrefParser($this->tree),
- ];
- }
-
- /**
- * @return string
- */
- public function getName(): string
+ public function register(ConfigurableEnvironmentInterface $environment): void
{
- return 'xref';
+ $environment
+ ->addInlineParser(new XrefParser($this->tree));
}
}