fix indentation, encode entities

also swap `</pre></code>` to `</code></pre>` so nesting works properly
and fix a `</>` that should have been an `</a>`