alled by plugin.js, when user clicks 'Ok' button
        function submit() {
            "use strict";

            var cc = '&#x0;', isDirty = codemirror.isDirty, doc = codemirror.doc;

            if (doc.somethingSelected()) {
                // Clear selection:
                doc.setCursor(doc.getCursor());
            }

            // Insert cursor placeholder (&#x0;)
            doc.replaceSelection(cc);

            var pos = codemirror.getCursor(),
                curLineHTML = doc.getLine(pos.lin