$ gnpm install micromark-util-encode
micromark utility to encode dangerous html characters.
npm:
npm install micromark-util-encode
import {encode} from 'micromark-util-encode'
encode('<3') // '<3'
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.
value
(string
) — Value to encode.string
— Encoded value.
See security.md
in micromark/.github
for how to
submit a security report.
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.
Copyright 2013 - present © cnpmjs.org | Home |