Adding to html_escape() an optional parameter $double_encode = TRUE. $double_encode = FALSE prevents escaping twice.