fix indentation, encode entities

also swap </pre></code> to </code></pre>
so nesting works properly