Skip to main content
Home

Functions for HTML, such as escaping or unescaping HTML entities

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
94%
Published
3 months ago (1.0.5)

default

Functions for HTML tasks such as escaping or unescaping HTML entities.

T
EntityList

Object structure for a list of HTML entities.

f
escape

Escapes text for safe interpolation into HTML text content and quoted attributes.

f
unescape

Unescapes HTML entities in text.

T
UnescapeOptions

Options for unescape.

T
EntityList

Object structure for a list of HTML entities.

f
escape

Escapes text for safe interpolation into HTML text content and quoted attributes.

f
unescape

Unescapes HTML entities in text.

T
UnescapeOptions

Options for unescape.

v
default
No documentation available
f
escapeCss

Escapes a string for direct interpolation into an external CSS style sheet, within a <style> element, or in a selector.

f
escapeJs

Escapes a JavaScript object or other data for safe interpolation inside a <script> tag.

T
EscapeJsOptions

Options for escapeJs

f
isValidCustomElementName

Returns whether the given string is a valid custom element name, as per the requirements defined in https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.