-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Description
You could improve the following formatting logic :
Lines 75 to 80 in 7129f17
html = _.trim(html.text()); | |
html = html.replace(/\r\n\n/g, '\n'); | |
html = html.replace(/\t/g, ''); | |
html = html.replace(/\n\r\n/g, '\n'); | |
html = html.replace(/ +/g, ' '); | |
html = html.replace(/\n /g, '\n'); |
With :
html = html.text()
.replace(/\r\n/g, '\n') // windows to linux new line style
.replace(/\t/g, '') // no tabs
.replace(/ +/g, ' ') // whitespaces
.split('\n').map(line => line.trim()).join('\n') // trim every line
.replace(/\n{3,}/g, '\n\n'); // no more than two new lines in a row
This would fix the formatting issues seen on lyrics.ovh.
Metadata
Metadata
Assignees
Labels
No labels