micromark-util-encode
micromark utility to encode dangerous html characters
Last updated 3 years ago by wooorm .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install micromark-util-encode 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.1                                ...           latest (3 years ago)
  • 1.0.0-beta.1                                ...           next (4 years ago)

6 Versions

  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           4 years ago
  • 1.0.0-beta.1                                ...           4 years ago
  • 1.0.0-alpha.3                                ...           4 years ago
  • 1.0.0-alpha.2                                ...           4 years ago
  • 1.0.0-alpha.1                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 0
Last Month 0
Dependencies (0)
None
Dev Dependencies (0)
None

Copyright 2013 - present © cnpmjs.org | Home |