Skip to content

Commit 7972210

Browse files
committed
update monitor params
1 parent 286721c commit 7972210

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Wanfang Data.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"inRepository": true,
1010
"translatorType": 4,
1111
"browserSupport": "gcsibv",
12-
"lastUpdated": "2025-06-19 15:33:45"
12+
"lastUpdated": "2025-07-11 03:58:04"
1313
}
1414

1515
/*
@@ -71,9 +71,9 @@ const typeMap = {
7171
};
7272

7373
function detectWeb(doc, url) {
74-
const dynamic = doc.querySelector('body, .container-flex, .periodical');
74+
const dynamic = doc.querySelector('#app, .container-flex, .periodical');
7575
if (dynamic) {
76-
Z.monitorDOMChanges(dynamic, { childList: true });
76+
Z.monitorDOMChanges(dynamic, { childList: true, subtree: true });
7777
}
7878
for (const key in typeMap) {
7979
if (new RegExp(`/${key}/`, 'i').test(url)) {
@@ -191,7 +191,7 @@ async function scrapePage(doc, type, id) {
191191
newItem.date = tryMatch(pubInfo, /^\d{4}/);
192192
newItem.volume = tryMatch(pubInfo, /,0*(\d+)\(/, 1);
193193
newItem.issue = tryMatch(pubInfo, /\((.+?)\)/, 1).replace(/0*(\d+)/, '$1');
194-
newItem.publicationTitle = text(doc, '.periodicalName');
194+
newItem.publicationTitle = text(doc, '.periodicalName').replace(/\(([^)]+)\)$/, '($1)');
195195
newItem.pages = tryMatch(data('页数'), /\((.+)\)/, 1)
196196
.replace(/\b0*(\d+)/, '$1')
197197
.replace(/\+/g, ',')
@@ -419,7 +419,7 @@ function parseJson(json, type, id) {
419419
}[json.language] || 'zh-CN';
420420
switch (newItem.itemType) {
421421
case 'journalArticle': {
422-
newItem.publicationTitle = json.periodicaltitleList[0];
422+
newItem.publicationTitle = json.periodicaltitleList[0].replace(/\(([^)]+)\)$/, '($1)');
423423
extra.set('original-container-title', json.periodicaltitleList[1], true);
424424
newItem.volume = json.volum;
425425
newItem.issue = json.issue;

0 commit comments

Comments
 (0)