Skip to content

Commit d95283f

Browse files
authored
Add tests for multiline inline shortcodes
Closes #6
1 parent e366879 commit d95283f

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

examples/basic.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@
3838
more
3939
}}}
4040
41-
Postipsum.
41+
Postipsum with a multiline {inline-shortcode
42+
|foo
43+
|bar=''
44+
|baz=3
45+
} that should work.
4246
")->getContent();
4347

4448
/* Output:

tests/ShortcodeExtensionTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ public function provideBasics(): array
5454
],
5555
'output' => "<p>Foo e fc baz</p>\n",
5656
],
57+
'inline-with-linebreaks' => [
58+
'markdown' => "Foo {bar\n|name=Douglas\n|id=Q42\n} baz",
59+
'shortcodes' => [
60+
'bar' => static function (Shortcode $sc) {
61+
return '--' . $sc->getAttr('name') . '--';
62+
},
63+
],
64+
'output' => "<p>Foo --Douglas-- baz</p>\n",
65+
],
5766
'inline-escape-chars' => [
5867
'markdown' => 'outer {one| inner1 {two\|inner2\}}',
5968
'shortcodes' => [

0 commit comments

Comments
 (0)