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')) ? "[$matches[2]]" : $matches[0]; diff --git a/javascript/shortcodable.js b/javascript/shortcodable.js index d5be799..f483b9d 100644 --- a/javascript/shortcodable.js +++ b/javascript/shortcodable.js @@ -35,7 +35,6 @@ var ed = this.getEditor(); var newContent = shortcodable.replacePlaceholdersWithShortcodes($(this).val(), ed); $(this).val(newContent); - ed.save(); } }, });