From 1caabb0be6e55ce731ca10d7af4444a6e8770364 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 1 Nov 2019 20:01:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96neditor=E7=9A=84=E9=80=89?= =?UTF-8?q?=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/neditor/index.wc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/neditor/index.wc b/src/neditor/index.wc index 0a07955..2ac6d7c 100644 --- a/src/neditor/index.wc +++ b/src/neditor/index.wc @@ -477,10 +477,7 @@ export default class Neditor { }) //监听鼠标事件的,以缓存选中状态 - this.__mouseFn = bind(this.__EDITOR__, 'mouseup', ev => { - this.__FONT__.classList.remove('fadein') - this.__COLOR__.classList.remove('fadein') - this.__LINK__.classList.remove('fadein') + this.__mouseFn = bind(this.__EDITOR__, 'mouseleave', ev => { this.saveSelection() }) @@ -501,7 +498,8 @@ export default class Neditor { if (html) { html = html .replace(/\t/g, ' ') - .replace(/]*>/, '') + .replace(/<\/?(meta|link|script)[^>]*?>/g, '') + .replace(//g, '') .replace( /]*? href\s?=\s?["']?([^"']*)["']?[^>]*?>/g, '' @@ -550,7 +548,7 @@ export default class Neditor { unbind(this.__FONT__, 'click', this.__fontFn) unbind(this.__COLOR__, 'click', this.__colorFn) unbind(this.__LINK_BTN__, 'click', this.__linkFn) - unbind(this.__EDITOR__, 'mouseup', this.__mouseFn) + unbind(this.__EDITOR__, 'mouseleave', this.__mouseFn) unbind(this.__EDITOR__, 'paste', this.__pasteFn) this.__observer.disconnect() }