An example:
<p> Hello</p>
<div>hgello</div>
<pre>
code
code
<pre>
turns in something like:
<p> Hello</p><div>hgello</div><pre>
code
code
<pre>
How to do this in python? I make also intensive use of < pre> tags so substituting all '\n' with '' is not an option.
What's the best way to do that?