Remove extra whitespace

- In order to match the markdown editor, remove
  all empty tags instead of just trailing ones.