Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/html_parser/src/utils/entities/mod.ts>encodeHTML4

Port of fb55/htmlparser2 for Deno
Latest
variable encodeHTML4
import { encodeHTML4 } from "https://deno.land/x/html_parser@v0.1.3/src/utils/entities/mod.ts";

Encodes all entities and non-ASCII characters in the input.

This includes characters that are valid ASCII characters in HTML documents. For example # will be encoded as #. To get a more compact output, consider using the encodeNonAsciiHTML function.

If a character has no equivalent entity, a numeric hexadecimal reference (eg. ü) will be used.