JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11015694
  • Score
    100M100P100Q245745F
  • License MIT

micromark utility to encode dangerous html characters

Package Exports

  • micromark-util-encode

Readme

micromark-util-encode

Build Coverage Downloads Size Sponsors Backers Chat

micromark utility to encode dangerous html characters.

Contents

Install

npm:

npm install micromark-util-encode

Use

import {encode} from 'micromark-util-encode'

encode('<3') // '&lt;3'

API

This module exports the following identifiers: encode. There is no default export.

encode(value)

Encode only the dangerous HTML characters.

This ensures that certain characters which have special meaning in HTML are dealt with. Technically, we can skip > and " in many cases, but CM includes them.

Parameters
  • value (string) — Value to encode.
Returns

string — Encoded value.

Security

See security.md in micromark/.github for how to submit a security report.

Contribute

See contributing.md in micromark/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Titus Wormer