AK-21/Graphite-Industrial-Intelligence
0
1<!--This file is generated-->2 3# html-url-attributes4 5[![Build][build-badge]][build]6[![Coverage][coverage-badge]][coverage]7[![Downloads][downloads-badge]][downloads]8[![Size][size-badge]][size]9[![Sponsors][funding-sponsors-badge]][funding]10[![Backers][funding-backers-badge]][funding]11[![Chat][chat-badge]][chat]12 13Utility with info on URL attributes.14 15## Contents16 17* [What is this?](#what-is-this)18* [When should I use this?](#when-should-i-use-this)19* [Install](#install)20* [Use](#use)21* [API](#api)22 * [`urlAttributes`](#urlattributes)23* [Syntax](#syntax)24* [Syntax tree](#syntax-tree)25* [Types](#types)26* [Compatibility](#compatibility)27* [Security](#security)28* [Contribute](#contribute)29* [License](#license)30 31## What is this?32 33This package contains info on attributes that have URLs as values.34 35## When should I use this?36 37You can use this package any time you’re rewriting URLs.38 39## Install40 41This package is [ESM only][esm].42In Node.js (version 16+), install with [npm][]:43 44```sh45npm install html-url-attributes46```47 48In Deno with [`esm.sh`][esm-sh]:49 50```js51import {urlAttributes} from 'https://esm.sh/html-url-attributes@3'52```53 54In browsers with [`esm.sh`][esm-sh]:55 56```html57<script type="module">58 import {urlAttributes} from 'https://esm.sh/html-url-attributes@3?bundle'59</script>60```61 62## Use63 64```js65import {urlAttributes} from 'html-url-attributes'66 67console.log(urlAttributes.formAction)68//=> ['button', 'input']69console.log(urlAttributes.href)70//=> ['a', 'area', 'base', 'link']71```72 73## API74 75This package exports the identifier76`urlAttributes`.77There is no default export.78 79### `urlAttributes`80 81HTML URL properties (`Record<string, Array<string> | null>`).82 83Each key is a property name and each value is a list of tag names it applies84to or `null` if it applies to all elements.85 86## Syntax87 88HTML is parsed according to WHATWG HTML (the living standard), which is also89followed by all browsers.90 91## Syntax tree92 93The syntax tree used is [hast][].94 95## Types96 97This package is fully typed with [TypeScript][].98 99## Compatibility100 101Projects maintained by the unified collective are compatible with maintained102versions of Node.js.103 104When we cut a new major release, we drop support for unmaintained versions of105Node.106This means we try to keep the current release line,107`html-url-attributes@^3`,108compatible with Node.js 16.109 110## Security111 112As **rehype** works on HTML and improper use of HTML can open you up to a113[cross-site scripting (XSS)][xss] attack, use of rehype can also be unsafe.114Use [`rehype-sanitize`][rehype-sanitize] to make the tree safe.115 116## Contribute117 118See [`contributing.md`][contributing] in [`rehypejs/.github`][health] for ways119to get started.120See [`support.md`][support] for ways to get help.121 122This project has a [code of conduct][coc].123By interacting with this repository, organization, or community you agree to124abide by its terms.125 126## License127 128[MIT][license] © [Titus Wormer][author]129 130[author]: https://wooorm.com131 132[build]: https://github.com/rehypejs/rehype-minify/actions133 134[build-badge]: https://github.com/rehypejs/rehype-minify/workflows/main/badge.svg135 136[chat]: https://github.com/rehypejs/rehype/discussions137 138[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg139 140[coc]: https://github.com/rehypejs/.github/blob/main/code-of-conduct.md141 142[contributing]: https://github.com/rehypejs/.github/blob/main/contributing.md143 144[coverage]: https://codecov.io/github/rehypejs/rehype-minify145 146[coverage-badge]: https://img.shields.io/codecov/c/github/rehypejs/rehype-minify.svg147 148[downloads]: https://www.npmjs.com/package/html-url-attributes149 150[downloads-badge]: https://img.shields.io/npm/dm/html-url-attributes.svg151 152[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c153 154[esm-sh]: https://esm.sh155 156[funding]: https://opencollective.com/unified157 158[funding-backers-badge]: https://opencollective.com/unified/backers/badge.svg159 160[funding-sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg161 162[hast]: https://github.com/syntax-tree/hast163 164[health]: https://github.com/rehypejs/.github165 166[license]: https://github.com/rehypejs/rehype-minify/blob/main/license167 168[npm]: https://docs.npmjs.com/cli/install169 170[rehype-sanitize]: https://github.com/rehypejs/rehype-sanitize171 172[size]: https://bundlejs.com/?q=html-url-attributes173 174[size-badge]: https://img.shields.io/bundlejs/size/html-url-attributes175 176[support]: https://github.com/rehypejs/.github/blob/main/support.md177 178[typescript]: https://www.typescriptlang.org179 180[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting181 