aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-02 16:46:49 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-02 16:46:49 +1300
commit9fbf6257713bf33477edf1c43e3f6ef9229d78eb (patch)
treea6b5bafc18cc566942298ab49dd22d77006afbc3
parentMerge branch 'release/v0.07' into develop (diff)
downloadMusic-Lyrics-LRC-9fbf6257713bf33477edf1c43e3f6ef9229d78eb.tar.gz
Music-Lyrics-LRC-9fbf6257713bf33477edf1c43e3f6ef9229d78eb.zip
Handle blank lyric lines
In some LRC files, a timestamp with nothing after it except perhaps some whitespace means to blank the lyric area at that time for a part of the song with no lyrics, e.g.: [00:55.363] This patch handles this as a valid lyric line, and prevents it from being interpreted as a tag with the name "00".
-rw-r--r--lib/Music/Lyrics/LRC.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Music/Lyrics/LRC.pm b/lib/Music/Lyrics/LRC.pm
index f665437..693ed49 100644
--- a/lib/Music/Lyrics/LRC.pm
+++ b/lib/Music/Lyrics/LRC.pm
@@ -54,7 +54,9 @@ our %RE = (
) # End seconds group
\] # Closing right bracket
[\t ]* # Any tabs or spaces
- (.*\S) # Lyric line, capture
+ ( # Lyric line group, capture
+ (?:.*\S)? # Anything ending with non-whitespace
+ ) # End lyric line group
\s* # Any whitespace
\z # End of string
}msx,