Fixed bug #1162: HTML entities are not escaped properly.