diff --git a/code/extensions/ShortcodableShortcodeParserExtension.php b/code/extensions/ShortcodableShortcodeParserExtension.php index 05d6239..ad39cc1 100755 --- a/code/extensions/ShortcodableShortcodeParserExtension.php +++ b/code/extensions/ShortcodableShortcodeParserExtension.php @@ -4,15 +4,16 @@ class ShortcodableShortcodeParserExtension extends Extension { public function onBeforeParse(&$content) { + $parser = $this->owner; // Check the shortcode type and convert wrapper to div if block type // Regex examples: https://regex101.com/r/bFtD9o/3 $content = preg_replace_callback( '|
]*?)?>\s*?\[((.*)([\s,].*)?)\]\s*?
|U', - function ($matches) { + function ($matches) use($parser) { $shortcodeName = $matches[3]; // Since we're only concerned with shortcodable objects we know the // shortcode name will be the class name so don't have to look it up - return ($shortcodeName && $this->owner->registered($shortcodeName) + return ($shortcodeName && $parser->registered($shortcodeName) && Config::inst()->get($shortcodeName, 'shortcodable_is_block')) ? "