micromark-util-decode-string

micromark utility to decode markdown strings

Usage no npm install needed!

<script type="module">
  import micromarkUtilDecodeString from 'https://cdn.skypack.dev/micromark-util-decode-string';
</script>

README

micromark-util-decode-string

Build Coverage Downloads Size Sponsors Backers Chat

micromark utility to decode markdown strings.

Contents

Install

npm:

npm install micromark-util-decode-string

Use

import {decodeString} from 'micromark-util-decode-string'

decodeString('a &semi; b') // 'a ; b'
decodeString('a \\; b') // 'a ; b'
decodeString('a ; b') // 'a ; b'

API

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

decodeString(value)

micromark utility to decode markdown strings (which occur in places such as fenced code info strings, destinations, labels, and titles). The “string” content type allows character escapes and -references. This decodes those.

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

string — Decoded 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