mirror of
https://github.com/beetbox/beets.git
synced 2026-02-05 23:14:07 +01:00
Remove scripts from lyrics
This commit is contained in:
parent
4b11eed79f
commit
5b57032981
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