For the white space, put the content into
<pre></pre> or <code></code>
tags and|or use CSS to not have the output collapse the
whitespace.
For changing links that would require a bit of regex or some
other kind
of string processing. Not to difficult, but I don't have the
exact code.