Fix some incorrect spacing

- In HTML, keep enough spaces to preserve separation of inline elements.
- In plain text, use Markdown-like convention of sets of lines with 2 or
  more trailing spaces are formatted as hard-wrapped lines; otherwise,
  they are soft-wrapped.
- Update tests for above changes.