From 56ceca56c8b7e8f6c5dbe307944482bbcd0abafd Mon Sep 17 00:00:00 2001 From: example Date: Fri, 1 Mar 2019 09:41:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E6=9E=90=E8=A7=84=E5=88=99=E6=9B=B4?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- translate/translate-dictionary.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/translate/translate-dictionary.js b/translate/translate-dictionary.js index 0c5229b..fbce4ad 100644 --- a/translate/translate-dictionary.js +++ b/translate/translate-dictionary.js @@ -1,7 +1,7 @@ // ==UserScript== // @name 划词翻译:多词典查询 // @namespace http://tampermonkey.net/ -// @version 3.2 +// @version 3.3 // @description 划词翻译调用“有道词典(有道翻译)、金山词霸、Bing 词典(必应词典)、剑桥高阶、沪江小D、谷歌翻译” // @author https://github.com/barrer // @match http://*/* @@ -813,7 +813,8 @@ var dom = document.createElement('div'); dom.setAttribute('class', ids.ICIBA); try { - rst = /dict.innerHTML='(.*?)';\n \tdict.style.display = "block";/g.exec(rst)[1]; + rst = rst.replace(/\n/g, ' '); + rst = /dict.innerHTML='(.*)'; \tdict.style.display = "block";/g.exec(rst)[1]; rst = rst .replace(/\\"/g, '"') .replace(/\\'/g, '\'')