Skip to content

Commit

Permalink
Test shortcodes inside inline elements
Browse files Browse the repository at this point in the history
  • Loading branch information
samwilson committed Jan 26, 2024
1 parent b4435f9 commit fd9f2da
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 38 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"league/flysystem": "^1.0",
"myclabs/php-enum": "^1.5",
"samwilson/commonmark-latex": "^0.4",
"samwilson/commonmark-shortcodes": "^0.3",
"samwilson/commonmark-shortcodes": "^0.5",
"samwilson/phpflickr": "^4.13",
"symfony/cache": "^5.0",
"symfony/console": "^5.0",
Expand Down
66 changes: 33 additions & 33 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion example/content/tags/goats.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ Goats are a good example animal.

Here's a photo of one on Flickr:

{{{flickr id=20886993696 }}}
{{{flickr|id=20886993696
This is a *caption*.
}}}
2 changes: 1 addition & 1 deletion tests/TemplateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function testShortcodes(): void
\begin{document}
Test shortcodes. A file from Wikimedia Commons:
\\emph{Test \\textsc{shortcodes}.} A file from Wikimedia Commons:
Expand Down
6 changes: 4 additions & 2 deletions tests/test_site/content/shortcodes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
Test shortcodes. A file from Wikimedia Commons:
*Test {small-caps|shortcodes}.* A file from Wikimedia Commons:

{{{commons |file=Test.png }}}
{{{commons |file=Test.png
*Test caption.*
}}}
1 change: 1 addition & 0 deletions tests/test_site/templates/shortcodes/commons.html.twig
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<figure>
This is Commons file {{shortcode.attrs.file}}
<figcaption>{{shortcode.body|md2html|raw}}</figcaption>
</figure>
1 change: 1 addition & 0 deletions tests/test_site/templates/shortcodes/small-caps.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<span style="text-variant:smallcaps">{{shortcode.attrs.1}}</span>
1 change: 1 addition & 0 deletions tests/test_site/templates/shortcodes/small-caps.tex.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\textsc{{'{'}}{{shortcode.attrs.1}}{{'}'}}

0 comments on commit fd9f2da

Please sign in to comment.