1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-18 02:41:27 +02:00

feat(shortcodes): add ability to use markdown directive with markdown shortcode

This commit is contained in:
Awilum
2022-05-27 17:19:02 +03:00
parent 97e6bda8e0
commit 467758eba8
2 changed files with 19 additions and 4 deletions

View File

@@ -2,7 +2,17 @@
declare(strict_types=1);
test('[markdown] shortcode', function () {
$this->assertEquals("<p><strong>Foo</strong></p>\n",
parsers()->shortcodes()->parse('(markdown)**Foo**(/markdown)'));
beforeEach(function() {
filesystem()->directory(PATH['project'] . '/entries')->ensureExists(0755, true);
});
afterEach(function () {
filesystem()->directory(PATH['project'] . '/entries')->delete();
});
test('markdown shortcode', function () {
$this->assertEquals("<p><strong>Foo</strong></p>\n", parsers()->shortcodes()->parse('(markdown)**Foo**(/markdown)'));
expect(entries()->create('md', ['test' => '(markdown) **Foo**']))->toBeTrue();
expect(entries()->fetch('md')['test'])->toBe("<p> <strong>Foo</strong></p>");
});