CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
1# micromark-util-encode2 3[![Build][build-badge]][build]4[![Coverage][coverage-badge]][coverage]5[![Downloads][downloads-badge]][downloads]6[![Size][bundle-size-badge]][bundle-size]7[![Sponsors][sponsors-badge]][opencollective]8[![Backers][backers-badge]][opencollective]9[![Chat][chat-badge]][chat]10 11[micromark][] utility to encode dangerous html characters.12 13## Contents14 15* [What is this?](#what-is-this)16* [When should I use this?](#when-should-i-use-this)17* [Install](#install)18* [Use](#use)19* [API](#api)20  * [`encode(value)`](#encodevalue)21* [Types](#types)22* [Compatibility](#compatibility)23* [Security](#security)24* [Contribute](#contribute)25* [License](#license)26 27## What is this?28 29This package exposes an algorithm to make text safe for embedding in HTML.30 31## When should I use this?32 33This package might be useful when you are making your own micromark extensions.34 35## Install36 37This package is [ESM only][esm].38In Node.js (version 16+), install with [npm][]:39 40```sh41npm install micromark-util-encode42```43 44In Deno with [`esm.sh`][esmsh]:45 46```js47import {encode} from 'https://esm.sh/micromark-util-encode@1'48```49 50In browsers with [`esm.sh`][esmsh]:51 52```html53<script type="module">54  import {encode} from 'https://esm.sh/micromark-util-encode@1?bundle'55</script>56```57 58## Use59 60```js61import {encode} from 'micromark-util-encode'62 63encode('<3') // '&lt;3'64```65 66## API67 68This module exports the identifier [`encode`][api-encode].69There is no default export.70 71### `encode(value)`72 73Encode only the dangerous HTML characters.74 75This ensures that certain characters which have special meaning in HTML are76dealt with.77Technically, we can skip `>` and `"` in many cases, but CM includes them.78 79###### Parameters80 81* `value` (`string`)82  — value to encode83 84###### Returns85 86Encoded value (`string`).87 88## Types89 90This package is fully typed with [TypeScript][].91It exports no additional types.92 93## Compatibility94 95Projects maintained by the unified collective are compatible with maintained96versions of Node.js.97 98When we cut a new major release, we drop support for unmaintained versions of99Node.100This means we try to keep the current release line,101`micromark-util-encode@2`, compatible with Node.js 16.102This package works with `micromark@3`.103 104## Security105 106This package is safe.107See [`security.md`][securitymd] in [`micromark/.github`][health] for how to108submit a security report.109 110## Contribute111 112See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways113to get started.114See [`support.md`][support] for ways to get help.115 116This project has a [code of conduct][coc].117By interacting with this repository, organisation, or community you agree to118abide by its terms.119 120## License121 122[MIT][license] © [Titus Wormer][author]123 124<!-- Definitions -->125 126[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg127 128[build]: https://github.com/micromark/micromark/actions129 130[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg131 132[coverage]: https://codecov.io/github/micromark/micromark133 134[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-encode.svg135 136[downloads]: https://www.npmjs.com/package/micromark-util-encode137 138[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-encode139 140[bundle-size]: https://bundlejs.com/?q=micromark-util-encode141 142[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg143 144[backers-badge]: https://opencollective.com/unified/backers/badge.svg145 146[opencollective]: https://opencollective.com/unified147 148[npm]: https://docs.npmjs.com/cli/install149 150[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c151 152[esmsh]: https://esm.sh153 154[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg155 156[chat]: https://github.com/micromark/micromark/discussions157 158[license]: https://github.com/micromark/micromark/blob/main/license159 160[author]: https://wooorm.com161 162[health]: https://github.com/micromark/.github163 164[securitymd]: https://github.com/micromark/.github/blob/main/security.md165 166[contributing]: https://github.com/micromark/.github/blob/main/contributing.md167 168[support]: https://github.com/micromark/.github/blob/main/support.md169 170[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md171 172[typescript]: https://www.typescriptlang.org173 174[micromark]: https://github.com/micromark/micromark175 176[api-encode]: #encodevalue177 
basant307/AI_Governance_Project · CoolFace