diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-02 16:46:49 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2017-11-02 16:46:49 +1300 |
commit | 9fbf6257713bf33477edf1c43e3f6ef9229d78eb (patch) | |
tree | a6b5bafc18cc566942298ab49dd22d77006afbc3 | |
parent | Merge branch 'release/v0.07' into develop (diff) | |
download | Music-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.pm | 4 |
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, |