showSource() { let _this = this _this.isHTML = !_this.isHTML let _source = this.editor.getHTML() if (_this.isHTML) { _source = _source.replace(/</g, "<").replace(/>/g, ">").replace(/ /g, " ") } else { _source = _source.replace(/</ig, "<").replace(/>/ig, ">").replace(/ /ig, " ") } _source = _source.replace(/<p><p>/ig,'<p>').replace(/<\/p><\/p>/ig,'</p>') this.editor.commands.setContent(_source); }
isHTML = false;