Properly escape special characters using HTMLEntities (new dependency)