Notoriously Punctual Manatee

    micromark-util-encode
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.0 • Public • Published

    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

    Install

    npm i micromark-util-encode

    DownloadsWeekly Downloads

    108,756

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    4.78 kB

    Total Files

    3

    Last publish

    Collaborators

    • wooorm