修复逐字歌词丢失空格的问题

This commit is contained in:
itouakirai 2024-08-18 22:16:37 +08:00 committed by GitHub
parent 11d34f3601
commit b21a134d24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1856,7 +1856,12 @@ func conventSyllableTTMLToLRC(ttml string) (string, error) {
for _, div := range parsedTTML.FindElement("tt").FindElement("body").FindElements("div") {
for _, item := range div.ChildElements() {
var lrcSyllables []string
for _, lyric := range item.ChildElements() {
for _, lyrics := range item.Child {
if _, ok := lyrics.(*etree.CharData); ok {
lrcSyllables = append(lrcSyllables, " ")
continue
}
lyric := lyrics.(*etree.Element)
if lyric.SelectAttr("begin") == nil {
continue
}