Replace single CR by LF

This commit is contained in:
M66B
2022-01-09 19:09:55 +01:00
parent 0f4bfbfc04
commit 3c9b00daa8
4 changed files with 9 additions and 12 deletions

View File

@@ -1880,14 +1880,16 @@ public class HtmlHelper {
return flowed.toString();
}
static String formatPre(String text) {
return formatPre(text, true);
static String formatPlainText(String text) {
return formatPlainText(text, true);
}
static String formatPre(String text, boolean view) {
static String formatPlainText(String text, boolean view) {
int level = 0;
StringBuilder sb = new StringBuilder();
String[] lines = text.split("\\r?\\n");
String[] lines = text
.replaceAll("\\r(?!\\n)", "\n")
.split("\\r?\\n");
for (int l = 0; l < lines.length; l++) {
String line = lines[l];
lines[l] = null;