From 2647856746b93be12cbcc43d55cde0b43592f4f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=9D=97?= <57312083+fangkuia@users.noreply.github.com> Date: Thu, 9 Jan 2025 15:53:25 +0900 Subject: [PATCH] Update leijing.js --- js/leijing.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/js/leijing.js b/js/leijing.js index d6aad4e..393e993 100644 --- a/js/leijing.js +++ b/js/leijing.js @@ -71,8 +71,9 @@ $('.topicItem').each((index, each) => { const href = $(each).find('h2 a').attr('href'); const title = $(each).find('h2 a').text() - const match = title.match(/([\u4e00-\u9fa5]+(?:\s*[\u4e00-\u9fa5]*)*)/g); - const dramaName = match ? match[0] : title; + const regex = /(?:【.*?】)?(?:(.*?))?([^\s.(]+(?:\s+[^\s.(]+)*)/; + const match = title.match(regex); + const dramaName = match ? match[1] : title; const r = $(each).find('.summary').text(); const tag = $(each).find('.tag').text(); @@ -167,8 +168,9 @@ $('.topicItem').each((index, each) => { const href = $(each).find('h2 a').attr('href'); const title = $(each).find('h2 a').text() - const match = title.match(/([\u4e00-\u9fa5]+(?:\s*[\u4e00-\u9fa5]*)*)/g); - const dramaName = match ? match[0] : title; + const regex = /(?:【.*?】)?(?:(.*?))?([^\s.(]+(?:\s+[^\s.(]+)*)/; + const match = title.match(regex); + const dramaName = match ? match[1] : title; const r = $(each).find('.summary').text(); const tag = $(each).find('.tag').text();