Replace stripHtml logic to fix markup