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

x/html_parser/src/utils/entities/encode.ts>escape

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

Encodes all non-ASCII characters, as well as characters not valid in XML documents using numeric hexadecimal reference (eg. ü).

Have a look at escapeUTF8 if you want a more concise output at the expense of reduced transportability.

Parameters

data: string

String to escape.

Returns

string