Unwanted space around highlighted text in converted html

When I copy any block as html, there would be unwanted space around highlighted text, such as

<!-- directives: [] -->
<div id="content">
  <ul>
    <li>This is       <mark>a
      </mark>
 test.</li>
  </ul>
</div>


which means

This is ^^a^^ test.

would turn into

This is ^^a ^^test.