Skip to content

Commit

Permalink
fixed a classic editor bug
Browse files Browse the repository at this point in the history
  • Loading branch information
hyunsupul committed Aug 5, 2019
1 parent 7bc1f6a commit 6daa73f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
7 changes: 5 additions & 2 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Donate link: http://aesopstoryengine.com/donate
Tags: aesop, story, business, education, parallax, interactive, shortcode, gallery, grid gallery, thumbnail gallery,
Requires at least: 3.8
Tested up to: 5.0.3
Stable tag: 2.0.9
Stable tag: 2.0.10
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -185,8 +185,11 @@ Full documentation can be found here: [http://aesopstoryengine.com/developers](h
* Initial Release

== Changelog ==
= 2.0.10 =
* FIX fix for a bug in the visual editing mode under the Classical Editor.

= 2.0.9 =
* NEW New file type options for the Document component
* NEW New file type options for the Document component. Supports MS documents now.
* NEW Added buttons to remove images to a few Gutenberg blocks

= 2.0.8.5 =
Expand Down
6 changes: 3 additions & 3 deletions admin/assets/js/tinymce/aiview/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,16 @@

// restore the Aesop shortcode from the div placeholder
function restoreAesopShortcodes(content) {
return content.replace((/<div[^>]+?class="[^"]+?aesop-component-long.*?aesop-sc="([^"]+)"[\s\S]*?aesop-component-content[^>]*?>(.*?)<\/div>[\s]*?<\/div>|<div class="[^"+]+?aesop-component-short.*?aesop-sc="([^"]+)"[\s\S]*?WcMgcq<\/div><\/div>/g), function (match) {
return content.replace((/<div[^>]+?class="[^"]+?aesop-component-long.*?aesop-sc="([^"]+)"[\s\S]*?aesop-component-content[^>]*?>(.*?)<\/div>[\s]*?<\/div>|<div class="[^"+]+?aesop-component-short.*?aesop-sc="([^"]+)"[\s\S]*?WcMgcq<\/div>[\s]*<\/div>/g), function (match) {
return shortcode(match);
});
}

// return the shortcode equivalent for any matches and update the content with the new version
function shortcode(match) {
var re_full = /<div[^>]+?class="[^"]+?aesop-component.*?aesop-sc="([^"]+)"[\s\S]*?aesop-component-content[^>]*?>(.*?)<\/div>[\s]*?<\/div>/g;
var re_short = /<div class="[^"+]+?aesop-component.*?aesop-sc="([^"]+)"[\s\S]*?WcMgcq<\/div><\/div>/g;
var re_clean = /<div\s*class="clipboardControl[^>]+?><div\s*class="aesop[^>]+>\s*<\/div><\/div>/g;
var re_short = /<div class="[^"+]+?aesop-component.*?aesop-sc="([^"]+)"[\s\S]*?WcMgcq<\/div>[\s]*<\/div>/g;
var re_clean = /<div\s*class="clipboardControl[^>]+?><div\s*class="aesop[^>]+>\s*<\/div>[\s]*<\/div>/g;

match = match.replace(re_clean, '');
//var re_clean = /<p> <\/p>\s*/g;
Expand Down
2 changes: 1 addition & 1 deletion admin/assets/js/tinymce/aiview/plugin.min.js

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

Loading

0 comments on commit 6daa73f

Please sign in to comment.