Update lyricsParse.ts
This commit is contained in:
@@ -136,17 +136,12 @@ function parseFuriganaText(text: string): LyricLine[] {
|
|||||||
let match
|
let match
|
||||||
|
|
||||||
while ((match = tokenRegex.exec(lyricText)) !== null) {
|
while ((match = tokenRegex.exec(lyricText)) !== null) {
|
||||||
const kanji = match[1]
|
const [, kanji, furigana, plain] = match
|
||||||
const furigana = match[2]
|
|
||||||
const plain = match[3]
|
|
||||||
|
|
||||||
if (kanji && furigana) lyric.push([kanji, furigana])
|
if (kanji && furigana) lyric.push([kanji, furigana])
|
||||||
else if (plain) lyric.push(plain)
|
else if (plain) lyric.push(plain)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lyric.length > 0) {
|
if (lyric.length > 0) segments.push({ time, lyric })
|
||||||
segments.push({ time, lyric })
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return segments
|
return segments
|
||||||
|
|||||||
Reference in New Issue
Block a user