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;
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;