diff --git a/src/utils/lyrics.js b/src/utils/lyrics.js index aa7f23e..394b73c 100644 --- a/src/utils/lyrics.js +++ b/src/utils/lyrics.js @@ -28,7 +28,7 @@ export function parseLyric(lrc) { lrcObj.push({ time: time, rawTime: timeRegExpArr[0], - content: content.trim(), + content: trimContent(content), }); } } @@ -36,3 +36,8 @@ export function parseLyric(lrc) { lrcObj.sort((a, b) => a.time - b.time); return lrcObj; } + +function trimContent(content) { + let t = content.trim(); + return t.length < 1 ? content : t; +}