Trim extra spaces from HTML content