Skip to content
This repository was archived by the owner on Mar 5, 2023. It is now read-only.

Commit 48afc8b

Browse files
authored
Merge pull request #30 from 8fold/8fold-sites
switching out Shoop
2 parents c9dc0ff + 10e1f7c commit 48afc8b

File tree

2 files changed

+12
-14
lines changed

2 files changed

+12
-14
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": ">=7.0",
14-
"8fold/php-shoop": "0.4.*",
14+
"8fold/php-shoop-extras": "0.1.*",
1515
"nesbot/carbon": "2.35.*",
1616
"league/commonmark": "1.4.*"
1717
},

src/UIKit/Elements/Compound/Markdown.php

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
use League\CommonMark\HtmlRenderer;
1111
use League\CommonMark\Extension\Table\TableExtension;
1212

13-
use Eightfold\Shoop\Shoop;
13+
use Eightfold\ShoopExtras\Shoop;
1414

1515
class Markdown extends HtmlElement
1616
{
17-
private $markdown = '';
17+
// private $markdown = '';
1818

1919
private $config = [
2020
'html_input' => 'strip',
@@ -31,19 +31,17 @@ public function __construct(string $markdown, array $config = [])
3131

3232
public function unfold(): string
3333
{
34-
// Obtain a pre-configured Environment with all the standard CommonMark parsers/renderers ready-to-go
35-
$environment = Environment::createCommonMarkEnvironment();
34+
return Shoop::markdown($this->markdown)
35+
->html([], [], true, true, $this->config);
36+
// // Obtain a pre-configured Environment with all the standard CommonMark parsers/renderers ready-to-go
37+
// $environment = Environment::createCommonMarkEnvironment();
3638

37-
// Add this extension
38-
$environment->addExtension(new TableExtension());
39+
// // Add this extension
40+
// $environment->addExtension(new TableExtension());
3941

40-
// Instantiate the converter engine and start converting some Markdown!
41-
$converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));
42+
// // Instantiate the converter engine and start converting some Markdown!
43+
// $converter = new Converter(new DocParser($environment), new HtmlRenderer($environment));
4244

43-
return $converter->convertToHtml($this->markdown);
44-
45-
$converter = new CommonMarkConverter($this->config);
46-
47-
return $converter->convertToHtml($this->markdown);
45+
// return $converter->convertToHtml($this->markdown);
4846
}
4947
}

0 commit comments

Comments
 (0)