function escape
escape(str: string): stringEscapes text for safe interpolation into HTML text content and quoted attributes.
Examples
Example 1
Example 1
import { escape } from "@std/html/entities"; escape("<>'&AA"); // "<>'&AA" // Characters that don't need to be escaped will be left alone, // even if named HTML entities exist for them. escape("þð"); // "þð"
Parameters
str: string