mirror of
https://github.com/pi-hole/web.git
synced 2026-04-27 12:15:00 +01:00
Use for...of in more places
Signed-off-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
@@ -76,16 +76,16 @@ function parseLines(ta, str) {
|
||||
// Splitting the text on "\r"
|
||||
const lines = str.split(/(?=\r)/g);
|
||||
|
||||
for (let i = 0; i < lines.length; i++) {
|
||||
if (lines[i][0] === "\r") {
|
||||
for (let line of lines) {
|
||||
if (line[0] === "\r") {
|
||||
// This line starts with the "OVER" sequence. Replace them with "\n" before print
|
||||
lines[i] = lines[i].replaceAll("\r[K", "\n").replaceAll("\r", "\n");
|
||||
line = line.replaceAll("\r[K", "\n").replaceAll("\r", "\n");
|
||||
|
||||
// Last line from the textarea will be overwritten, so we remove it
|
||||
ta.text(ta.text().substring(0, ta.text().lastIndexOf("\n")));
|
||||
}
|
||||
|
||||
// Append the new text to the end of the output
|
||||
ta.append(lines[i]);
|
||||
ta.append(line);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user