From 07e75e2caddadd7cbc3a186d1e82d1b6d1673dbd Mon Sep 17 00:00:00 2001 From: CodFrm Date: Tue, 24 Mar 2020 11:53:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A1=AB=E7=A9=BA=E9=A2=98?= =?UTF-8?q?=E9=87=87=E9=9B=86bug=20#121?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config.js | 2 +- src/cxmooc-tools/chaoxing/topic.js | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/config.js b/src/config.js index 250e6daf..825f71a2 100644 --- a/src/config.js +++ b/src/config.js @@ -1,6 +1,6 @@ module.exports = { url: "https://cx.icodef.com/", - version: 2.11, + version: 2.12, update: 'https://github.com/CodFrm/cxmooc-tools/releases', enforce: false, cx: { diff --git a/src/cxmooc-tools/chaoxing/topic.js b/src/cxmooc-tools/chaoxing/topic.js index 1dcd35f6..31e06093 100644 --- a/src/cxmooc-tools/chaoxing/topic.js +++ b/src/cxmooc-tools/chaoxing/topic.js @@ -184,7 +184,11 @@ function getAnswerInfo(TiMu) { //验证正确 let title = $(answer).find('.clearfix'); let type = switchTopicType(common.substrEx(title.text(), '【', '】')); - let topic = common.removeHTML(title.html().substring(title.html().indexOf('】') + 1)); + title = title.html().substring(title[0].innerHTML.indexOf('】') + 1); + if (/((.+?)分)($|\s+)/.test(title)) { + title = title.substring(0, title.lastIndexOf("(")); + } + let topic = common.removeHTML(title); let options = $(TiMu).find('.Zy_ulTop .clearfix'); let ret = { answers: [], @@ -215,7 +219,7 @@ function getAnswerInfo(TiMu) { options = $(TiMu).find('.Py_tk span.font14'); if (options.length <= 0) { isMy = true; - options = $(TiMu).find('.Py_answer.clearfix'); + options = $(TiMu).find('.Py_answer.clearfix .font14'); } for (let i = 0; i < options.length; i++) { if (isMy) {