File tree Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Expand file tree Collapse file tree 1 file changed +28
-3
lines changed Original file line number Diff line number Diff line change @@ -88,6 +88,8 @@ export const getMWBSources = (htmlItem: HTMLElement) => {
88
88
if ( src . length === 0 ) {
89
89
const h3Texts = htmlItem . querySelectorAll ( 'h3' ) ;
90
90
91
+ let songIndex = 0 ;
92
+
91
93
for ( const h3 of h3Texts ) {
92
94
let isSong = h3 . classList . contains ( 'dc-icon--music' ) ;
93
95
const part = h3 . parentNode . classList . contains ( 'boxContent' ) === false ;
@@ -96,6 +98,10 @@ export const getMWBSources = (htmlItem: HTMLElement) => {
96
98
isSong = h3 . querySelector ( '.dc-icon--music' ) ? true : false ;
97
99
}
98
100
101
+ if ( isSong ) {
102
+ songIndex ++ ;
103
+ }
104
+
99
105
if ( isSong || part ) {
100
106
let data = '' ;
101
107
@@ -106,9 +112,28 @@ export const getMWBSources = (htmlItem: HTMLElement) => {
106
112
}
107
113
108
114
src += '@' + data ;
109
- const nextElement = h3 . nextElementSibling ?. querySelector ( 'p' ) ;
110
- if ( nextElement ) {
111
- src += ' ' + nextElement . textContent ;
115
+
116
+ const nextSibling = h3 . nextElementSibling ;
117
+
118
+ if ( nextSibling ) {
119
+ const nextElement = nextSibling . querySelector ( 'p' ) ;
120
+
121
+ if ( nextElement ) {
122
+ // handle element exception in mwb25.09
123
+ if ( isSong && songIndex === 2 && nextSibling . tagName === 'DIV' ) {
124
+ src += '@' + nextElement . textContent ;
125
+
126
+ const tmpSibling = nextSibling . nextElementSibling ?. querySelector ( 'p' ) ;
127
+
128
+ if ( tmpSibling ) {
129
+ src += ' ' + tmpSibling . textContent ;
130
+ }
131
+
132
+ continue ;
133
+ }
134
+
135
+ src += ' ' + nextElement . textContent ;
136
+ }
112
137
}
113
138
}
114
139
}
You can’t perform that action at this time.
0 commit comments