Sanitize AROUND shortcode
Try to use this instead: editor.focus(); var selected_text = editor.selection.getContent(); shortcode=”[checklist-box title=”” + e.data.title + ‘”]’ + selected_text + ‘[/checklist-box]’; editor.selection.setContent(shortcode); editor.setContent(editor.getContent()); Basically, I’m first forcing editor focus and then use setContent instead to change the content. In my tests there were still some glitches on the editor but the source was ok, so I … Read more