I'm seeking a solution to minimize the size of my HTML output stream by eliminating empty lines and whitespace. I've attempted using regex, but my current pattern is inadvertently removing entire script blocks. How can I refine my approach to ensure that script blocks remain intact?
Here's what I have tried:
html = Regex.Replace(html, ">\s+<", "><", RegexOptions.Compiled)