Skip to content

Commit 3f84ea8

Browse files
authored
Add Markdown tables' extension
1 parent 209e74c commit 3f84ea8

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

example/content/index.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ template: recent
55

66
Lorem ipsum. This is a test. It has [links](https://example.org/) and a [ref link to goats].[^1]
77

8+
| Tables | | |
9+
|--|--|--|
10+
| | work | |
11+
| | | as well. |
12+
813
[ref link to goats]: ./tags/goats.html
914

1015
[^1]: It can also have footnotes.

src/Twig.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
use League\CommonMark\Extension\CommonMark\Node\Inline\Image;
2424
use League\CommonMark\Extension\Footnote\FootnoteExtension;
2525
use League\CommonMark\Extension\InlinesOnly\InlinesOnlyExtension;
26+
use League\CommonMark\Extension\Table\TableExtension;
2627
use League\CommonMark\MarkdownConverter;
2728
use Psr\Cache\CacheItemPoolInterface;
2829
use Samwilson\CommonMarkLatex\LatexRendererExtension;
@@ -584,6 +585,7 @@ private function getCommonMarkEnvironment(string $format): CommonMarkEnvironment
584585
$environment->addExtension(new FootnoteExtension());
585586
$environment->addExtension(new ShortcodeExtension());
586587
$environment->addExtension(new AutolinkExtension());
588+
$environment->addExtension(new TableExtension());
587589

588590
return $environment;
589591
}

0 commit comments

Comments
 (0)