Skip to content

Commit

Permalink
Fix instruments containing links
Browse files Browse the repository at this point in the history
  • Loading branch information
the1812 committed Dec 22, 2019
1 parent f88f760 commit b3b2069
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 3 additions & 1 deletion dist/core/metadata/thb-wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ class THBWiki extends metadata_source_1.MetadataSource {
演奏: (data) => {
const name = 'instruments';
const rows = data.innerHTML.split('<br>').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 {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion src/core/metadata/thb-wiki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ export class THBWiki extends MetadataSource {
演奏: (data) => {
const name = 'instruments'
const rows = data.innerHTML.split('<br>').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 {
Expand Down

0 comments on commit b3b2069

Please sign in to comment.