I am trying to remove HTML tags from a string, but I want to remove line breaks. The code below doesn't work, and so far, I haven't found a regex solutions that works.
let input = "First<br>Second"
let cleaned = document.createElement("pre");
cleaned.innerHTML = input;
let output = cleaned.innerText;
console.log(output);
What I want: "First\nSecond"
What it returns: "FirstSecond"
How do I fix this?