From b3b206931c6acb6cbd47e6eda54f47e4c2e41cbb Mon Sep 17 00:00:00 2001 From: the1812 Date: Sun, 22 Dec 2019 22:30:57 +0800 Subject: [PATCH] Fix instruments containing links --- dist/core/metadata/thb-wiki.js | 4 +++- package-lock.json | 2 +- src/core/metadata/thb-wiki.ts | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/core/metadata/thb-wiki.js b/dist/core/metadata/thb-wiki.js index ede8967..73d58c2 100644 --- a/dist/core/metadata/thb-wiki.js +++ b/dist/core/metadata/thb-wiki.js @@ -99,7 +99,9 @@ class THBWiki extends metadata_source_1.MetadataSource { 演奏: (data) => { const name = 'instruments'; const rows = data.innerHTML.split('
').map(it => { - const [instrument, performer] = it.trim().split(':'); + const [instrument, performer] = it.trim().split(':').map(row => { + return new jsdom_1.JSDOM(row).window.document.body.textContent; + }); return performer ? performer : instrument; }); return { diff --git a/package-lock.json b/package-lock.json index 61a19c0..701da48 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "touhou-tagger", - "version": "1.0.6", + "version": "1.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/core/metadata/thb-wiki.ts b/src/core/metadata/thb-wiki.ts index e2e7690..f14e537 100644 --- a/src/core/metadata/thb-wiki.ts +++ b/src/core/metadata/thb-wiki.ts @@ -101,7 +101,9 @@ export class THBWiki extends MetadataSource { 演奏: (data) => { const name = 'instruments' const rows = data.innerHTML.split('
').map(it => { - const [instrument, performer] = it.trim().split(':') + const [instrument, performer] = it.trim().split(':').map(row => { + return new JSDOM(row).window.document.body.textContent!! + }) return performer ? performer : instrument }) return {