Trim newlines at start/end of lyrics
Collapse more than one empty lines into one
This commit is contained in:
parent
56ede6c725
commit
aabd0367b9
2 changed files with 3 additions and 3 deletions
|
|
@ -44,10 +44,10 @@ public abstract class AbsSynchronizedLyrics extends Lyrics {
|
||||||
|
|
||||||
for (int i = 0; i < lines.size(); i++) {
|
for (int i = 0; i < lines.size(); i++) {
|
||||||
String line = lines.valueAt(i);
|
String line = lines.valueAt(i);
|
||||||
sb.append(line).append('\n');
|
sb.append(line).append("\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return sb.toString();
|
return sb.toString().trim().replaceAll("(\r?\n){3,}", "\r\n\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.getText();
|
return super.getText();
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ public class Lyrics {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getText() {
|
public String getText() {
|
||||||
return this.data;
|
return this.data.trim().replaceAll("(\r?\n){3,}", "\r\n\r\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue