From b8b6986e01044970a68100d4dd80bd579c056203 Mon Sep 17 00:00:00 2001 From: Jonathon Menz Date: Wed, 30 Nov 2016 18:20:49 -0800 Subject: [PATCH 1/2] Revert "Edit HTML Source not Saving HTML" This reverts commit 165ce3b013aef1db6f0dea0ba08b97e7e81428f0, due to introducing breaking change #49 --- javascript/shortcodable.js | 1 - 1 file changed, 1 deletion(-) 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(); } }, }); From 00e47b86e3aec4867d39828a78e8b25cfad570a5 Mon Sep 17 00:00:00 2001 From: Jonathon Menz Date: Wed, 30 Nov 2016 18:21:24 -0800 Subject: [PATCH 2/2] PHP 5.3 compatibility fix for parser extension --- code/extensions/ShortcodableShortcodeParserExtension.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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];