mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 11:02:43 +01:00
Merge pull request #927 from Bombardment/master
Remove scripts from lyrics
This commit is contained in:
commit
4bb852671f
1 changed files with 1 additions and 0 deletions
|
|
@ -122,6 +122,7 @@ def strip_cruft(lyrics, wscollapse=True):
|
|||
lyrics = unescape(lyrics)
|
||||
if wscollapse:
|
||||
lyrics = re.sub(r'\s+', ' ', lyrics) # Whitespace collapse.
|
||||
lyrics = re.sub(r'<(script).*?</\1>(?s)', '', lyrics) # Strip script tags
|
||||
lyrics = BREAK_RE.sub('\n', lyrics) # <BR> newlines.
|
||||
lyrics = re.sub(r'\n +', '\n', lyrics)
|
||||
lyrics = re.sub(r' +\n', '\n', lyrics)
|
||||
|
|
|
|||
Loading…
Reference in a new issue