• Hi Aram,

    My plugin makes use of TinyMCE capabilities to send to the active editor a code for shortcode. For example:

    tinymce.activeEditor.setContent(tinymce.activeEditor.getContent() + code);

    where code is:
    [google-map-v3 shortcodeid="2f7aeac0" width="350" height="350" zoom="12" maptype="roadmap" mapalign="center" ...........]

    It works fine if your plugin disabled or not there, this functionality breaks when your plugin is active. the following error is received:
    Uncaught Error: Syntax error, unrecognized expression: [google-map-v3 shortcodeid="2f7aeac0" width="350" height="350" zoom="12" maptype="roadmap" mapalign="center" ........ ]

    Please advise,

    Thank you

    http://ww.wp.xz.cn/plugins/crayon-syntax-highlighter/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter alexanderzagniotov

    (@alexanderzagniotov)

    Ok, what is causing the problem is inside crayon_tinymce.js#onBeforeSetContent:

    ed.onBeforeSetContent.add(function (ed, o) {
                            // Remove all selected pre tags
                            var content = $(o.content);
                            var wrapper = $('<div>');
                            content.each(function () {
                                $(this).removeClass(s.css_selected);
                                wrapper.append($(this).clone());
                            });
                            o.content = wrapper.html();
                        });

    specifically: var content = $(o.content);

    Thread Starter alexanderzagniotov

    (@alexanderzagniotov)

    Anyway, I added a work around in my plugin, lets see how it plays out with yours

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Your plugin JS tweaks TinyMCE?’ is closed to new replies.