Kludgy attempt at maintaining HTML entities