Improved new line processing

pull/178/head
M66B 5 years ago
parent 45d8c5f9ec
commit 33d0ac0868

@ -2006,12 +2006,19 @@ public class HtmlHelper {
} }
private void newline(int index) { private void newline(int index) {
int len = ssb.length(); int count = 0;
if (len > 2 && int i = Math.min(index, ssb.length() - 1);
ssb.charAt(len - 1) == '\n' && while (i >= 0) {
ssb.charAt(len - 2) == '\n') char kar = ssb.charAt(i);
return; if (kar == '\n')
ssb.insert(index, "\n"); count++;
else if (kar != ' ' && kar != '\u00A0')
break;
i--;
}
if (count < 2)
ssb.insert(index, "\n");
} }
}, document.body()); }, document.body());

Loading…
Cancel
Save