File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 5
5
namespace Baraja \MarkdownLatteFilter ;
6
6
7
7
8
- use Baraja \Markdown \CommonMarkRenderer ;
8
+ use Baraja \Markdown \Markdown ;
9
9
use Nette \Utils \Html ;
10
10
11
11
final class MarkdownFilter
12
12
{
13
13
public function __construct (
14
- private CommonMarkRenderer $ commonMarkRenderer ,
14
+ private Markdown $ markdown ,
15
15
) {
16
16
}
17
17
@@ -32,7 +32,7 @@ public function __invoke(string|object $haystack): Html
32
32
}
33
33
34
34
return Html::el ('div ' , ['class ' => 'markdown ' ])->setHtml (
35
- $ this ->commonMarkRenderer ->render ($ haystack ),
35
+ $ this ->markdown ->render ($ haystack ),
36
36
);
37
37
}
38
38
}
Original file line number Diff line number Diff line change @@ -15,6 +15,9 @@ public function beforeCompile(): void
15
15
{
16
16
$ builder = $ this ->getContainerBuilder ();
17
17
18
+ $ builder ->addDefinition ($ this ->prefix ('markdownFilter ' ))
19
+ ->setFactory (MarkdownFilter::class);
20
+
18
21
/** @var FactoryDefinition $latteFactory */
19
22
$ latteFactory = $ builder ->getDefinitionByType (LatteFactory::class);
20
23
$ latteFactory ->getResultDefinition ()
You can’t perform that action at this time.
0 commit comments