Encode HTML character references and character entities. By default, all dangerous, non-ASCII, or non-printable ASCII characters are encoded. A subset of characters can be given to encode just those characters. Alternatively, pass escapeOnly to escape just the dangerous characters (", ', <, >, &, `). By default, numeric entities are used. Pass useNamedReferences to use named entities when possible, or useShortestReferences to use them if that results in less bytes.