From 76d32c1cb4ea9a92caad6bb7fa2e651a41abeac6 Mon Sep 17 00:00:00 2001 From: lyswhut Date: Sat, 10 Dec 2022 14:48:01 +0800 Subject: [PATCH] fix match --- src/common/utils/lyric-font-player/line-player.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/utils/lyric-font-player/line-player.js b/src/common/utils/lyric-font-player/line-player.js index af6ddb30..fb8e7920 100644 --- a/src/common/utils/lyric-font-player/line-player.js +++ b/src/common/utils/lyric-font-player/line-player.js @@ -24,7 +24,7 @@ const parseExtendedLyric = (lrcLinesMap, extendedLyric) => { const times = timeField.match(timeExp) if (times == null) continue for (const time of times) { - const timeStr = time.replace(/(?:\.0+|0+)$/, '') + const timeStr = time.replace(/(?:\.0+|(\.\d+?)0+)$/, '$1') const targetLine = lrcLinesMap[timeStr] if (targetLine) targetLine.extendedLyrics.push(text) } @@ -83,7 +83,7 @@ module.exports = class LinePlayer { const times = timeField.match(timeExp) if (times == null) continue for (const time of times) { - const timeStr = time.replace(/(?:\.0+|0+)$/, '') + const timeStr = time.replace(/(?:\.0+|(\.\d+?)0+)$/, '$1') if (linesMap[timeStr]) { linesMap[timeStr].extendedLyrics.push(text) continue