I downloaded files through FTP and it added newlines after each line. Now, in my code I had blank lines added for context. After downloading, each empty line I added is now three empty lines.
So if I remove all blank lines with a regex expression like this ^\n
it removes also those lines I added for context. And this ^\n{1}
doesn't help either.
This is an example of HTML that I have now after downloading it through FTP:
<nav>
<ul>
<li><a href="#">London</a></li>
<li><a href="#">Paris</a></li>
<li><a href="#">Tokyo</a></li>
</ul>
</nav>
<div>new context</div>
<div>new context</div>
This is what I would want it to look like:
<nav>
<ul>
<li><a href="#">London</a></li>
<li><a href="#">Paris</a></li>
<li><a href="#">Tokyo</a></li>
</ul>
</nav>
<div>new context</div>
<div>new context</div>
Basically what I need is a regex expression that would find all empty lines that aren't after or before another empty line.