feat: filter empty lines in subtitle rendering for improved display

This commit is contained in:
Harvey Zack committed 2024-09-22 21:33:42 +08:00
1 parent 1e63b8dc83
commit c9d2d6c194
5 files changed
+7 -6

No files matched your search

+3 -2
View File
@@ -78,10 +78,11 @@ export default class Subtitle extends Component {
.map((cue, index) =>
cue.text
.split(/\r?\n/)
.filter((line) => line.trim())
.map(
(item) =>
(line) =>
`<div class="art-subtitle-line" data-group="${index}">
${subtitle.escape ? escape(item) : item}
${subtitle.escape ? escape(line) : line}
</div>`,
)
.join(''),