Encode single quote into &#x27; instead of &apos; which does not appear in HTML.