diff --git a/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php b/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php index dc97f282..0863b397 100644 --- a/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php +++ b/src/flextype/core/Parsers/Shortcodes/StringsShortcode.php @@ -89,6 +89,9 @@ parsers()->shortcodes()->addHandler('strings', static function (ShortcodeInterfa $content = strings($content)->{'base64Decode'}()->toString(); } + if ($key == 'base64Encode') { + $content = strings($content)->{'base64Encode'}()->toString(); + } } return (string) $content; diff --git a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php index 97c5d546..64b19852 100644 --- a/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php +++ b/tests/src/flextype/core/Parsers/Shortcodes/StringsShortcodeTest.php @@ -42,4 +42,7 @@ test('[strings] shortcode', function () { // base64Decode $this->assertEquals("test", parsers()->shortcodes()->parse('[strings base64Decode]dGVzdA==[/strings]')); + + // base64Encode + $this->assertEquals("dGVzdA==", parsers()->shortcodes()->parse('[strings base64Encode]test[/strings]')); }); \ No newline at end of file