hyunsupul/aesop-core

Custom component content not recognized for editing in Admin-Backend

Closed this issue · 1 comments

We created a custom component and registered a new shortcode for it.
The new component has multiple attributes and 'type' = 'wrap' set in the options returned for the 'aesop_avail_components' filter.

When creating the component in the admin backend the text is displayed properly in the TinyMCE editor. But once to click the Edit-Option the $content-Text is lost and when returning to the Editor a dangling [/aesop_my_custom_shortcode] Shortcode is visible.

The reason for this is an error in the 'parse' function in 'admin/assets/js/tinymce/aiview/plugin.js'.
The regular expression in 're_full' misses an underscore do properly detect the closing tag when the shortcode contains underscores.

Old:
var re_full = /\[aesop_([a-zA-Z_]+)\s([^\[\]]*)]([^\[\]]+)\[\/aesop_[a-zA-Z]+]/g;

Fixed:
var re_full = /\[aesop_([a-zA-Z_]+)\s([^\[\]]*)]([^\[\]]+)\[\/aesop_[a-zA-Z_]+]/g;

Hi I added this change and will be a part of the next release. Thank you