{"name":"rehype","version":"6.0.0","description":"HTML processor powered by plugins","license":"MIT","keywords":["html","abstract","syntax","tree","ast","parse","stringify","process"],"dependencies":{"rehype-parse":"^5.0.0","rehype-stringify":"^4.0.0","unified":"^7.0.0"},"homepage":"https://github.com/rehypejs/rehype","repository":{"type":"git","url":"https://github.com/rehypejs/rehype/tree/master/packages/rehype"},"bugs":{"url":"https://github.com/rehypejs/rehype/issues"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"http://wooorm.com"}],"files":["index.js"],"scripts":{},"xo":false,"_id":"rehype@6.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.0.0","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"dist":{"integrity":"sha512-eL2T5EAOTNTOdi5hRVXqO50yGOlg84wtlBSQ8PBfZo7ZFe8LGYBlFiCTg4/NesOcSTuqzhcxwoQGh3TKgAtw2w==","shasum":"873d4686c52d694560cf5d3f9e4440115840491d","tarball":"http://registry-npm.ywwl.com/rehype/download/rehype-6.0.0.tgz","fileCount":3,"unpackedSize":3089,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbTli7CRA9TVsSAnZWagAA2VoP/3XyuTl1qSAP3ZF6DNHT\ni2R3Zh/bsz9OgR6GGRvPlm63dkrALjACEeNkJYvbTVJ09SwuduAo6190NjoB\n02XagN/Syago5R41bTPt54bOyY9SMj98GxZvcRxdNAbC5IlYg4yk2qN+9Fi4\nKlEUUBtUGeMQJVWNb0QqTzTUMpOUL2PrcV8dJP97bRaiVbmTfTCCqXfcpOEr\n6AzXmvQZ904CMVKpDmvTGjpksgiItHecrDVVim6xoQAzvFdOHhzjL4iuIVbI\nDk+PReQ8v+blpacWWJUTHnhP2+OoEbUzeDPrd2Rqz51VJE7Cs96lyCYjNjiO\nPja8XSmDunM+vNxSWuO7tR8suVaNNvWIylhjelYIv+aLIpknYU5stY1WVqWy\n84lSi/cewxjKI8STxkvohA5lcAMW0izEZ3k4rtZlT/VVcNI0JE9DEsLRs9Sf\nzOYyNxSY0dC+OYeELNE2RdlkfoSBQIre8fJEzxCo/3NtaKNu/q/Lv/toLpKz\nSvXymQHhySWIeM6bG95kLar9KoGAj7k/U0DqDRdUKamffGR9PUjwg6VxI6Ys\nHXD3EljqtQFq4pUPy7peFdCYRgMsHFBALcsgnjtE2QxvvddnT0FUERYG+Esw\nJYanxCuX9QtdNwB1GGHG+mN/QuLZ8j+6HC9cUyt22aPgjzh24D5jdP8tEED8\nbN63\r\n=2aJ2\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBls9BT40tcWlNvP9ic5oNOu08PaynyTNWzE3fVNHq9+AiEAjAgOE536X1+wJQSByGMHR6d53gQS0nzk/rlIpUzAnbE="}],"size":1363,"noattachment":false,"key":"/rehype/-/rehype-6.0.0.tgz"},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rehype_6.0.0_1531861179639_0.05520607792834409"},"_hasShrinkwrap":false,"readme":"# rehype\n\n[![Build][build-badge]][build]\n[![Coverage][coverage-badge]][coverage]\n[![Downloads][downloads-badge]][downloads]\n[![Size][size-badge]][size]\n[![Sponsors][sponsors-badge]][collective]\n[![Backers][backers-badge]][collective]\n[![Chat][chat-badge]][chat]\n\n**[unified][]** processor to add support for parsing from HTML and serializing\nto HTML.\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When should I use this?](#when-should-i-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`rehype()`](#rehype-1)\n*   [Examples](#examples)\n    *   [Example: passing options to `rehype-parse`, `rehype-stringify`](#example-passing-options-to-rehype-parse-rehype-stringify)\n*   [Syntax](#syntax)\n*   [Syntax tree](#syntax-tree)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Contribute](#contribute)\n*   [Sponsor](#sponsor)\n*   [License](#license)\n\n## What is this?\n\nThis package is a [unified][] processor with support for parsing HTML as input\nand serializing HTML as output by using unified with\n[`rehype-parse`][rehype-parse] and [`rehype-stringify`][rehype-stringify].\n\nSee [the monorepo readme][rehype] for info on what the rehype ecosystem is.\n\n## When should I use this?\n\nYou can use this package when you want to use unified, have HTML as input, and\nwant HTML as output.\nThis package is a shortcut for\n`unified().use(rehypeParse).use(rehypeStringify)`.\nWhen the input isn’t HTML (meaning you don’t need `rehype-parse`) or the\noutput is not HTML (you don’t need `rehype-stringify`), it’s recommended to\nuse `unified` directly.\n\nWhen you’re in a browser, trust your content, don’t need positional info on\nnodes or formatting options, and value a smaller bundle size, you can use\n[`rehype-dom`][rehype-dom] instead.\n\nWhen you want to inspect and format HTML files in a project on the command\nline, you can use [`rehype-cli`][rehype-cli].\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install rehype\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {rehype} from 'https://esm.sh/rehype@13'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {rehype} from 'https://esm.sh/rehype@13?bundle'\n</script>\n```\n\n## Use\n\nSay we have the following module `example.js`:\n\n```js\nimport {rehype} from 'rehype'\nimport rehypeFormat from 'rehype-format'\n\nconst file = await rehype().use(rehypeFormat).process(`<!doctype html>\n        <html lang=en>\n<head>\n    <title>Hi!</title>\n  </head>\n  <body>\n    <h1>Hello!</h1>\n\n</body></html>`)\n\nconsole.error(String(file))\n```\n\n…running that with `node example.js` yields:\n\n```html\n<!doctype html>\n<html lang=\"en\">\n  <head>\n    <title>Hi!</title>\n  </head>\n  <body>\n    <h1>Hello!</h1>\n  </body>\n</html>\n```\n\n## API\n\nThis package exports the identifier [`rehype`][api-rehype].\nThere is no default export.\n\n### `rehype()`\n\nCreate a new unified processor that already uses\n[`rehype-parse`][rehype-parse] and [`rehype-stringify`][rehype-stringify].\n\nYou can add more plugins with `use`.\nSee [`unified`][unified] for more information.\n\n## Examples\n\n### Example: passing options to `rehype-parse`, `rehype-stringify`\n\nWhen you use `rehype-parse` or `rehype-stringify` manually you can pass options\ndirectly to them with `use`.\nBecause both plugins are already used in `rehype`, that’s not possible.\nTo define options for them, you can instead pass options to `data`:\n\n```js\nimport {rehype} from 'rehype'\nimport {reporter} from 'vfile-reporter'\n\nconst file = await rehype()\n  .data('settings', {\n    emitParseErrors: true,\n    fragment: true,\n    preferUnquoted: true\n  })\n  .process('<div title=\"a\" title=\"b\"></div>')\n\nconsole.error(reporter(file))\nconsole.log(String(file))\n```\n\n…yields:\n\n```txt\n1:21-1:21 warning Unexpected duplicate attribute duplicate-attribute hast-util-from-html\n\n⚠ 1 warning\n```\n\n```html\n<div title=a></div>\n```\n\n## Syntax\n\nHTML is parsed and serialized according to WHATWG HTML (the living standard),\nwhich is also followed by all browsers.\n\n## Syntax tree\n\nThe syntax tree format used in rehype is [hast][].\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports no additional types.\n\n## Compatibility\n\nProjects maintained by the unified collective are compatible with maintained\nversions of Node.js.\n\nWhen we cut a new major release, we drop support for unmaintained versions of\nNode.\nThis means we try to keep the current release line, `rehype@^13`, compatible\nwith Node.js 16.\n\n## Security\n\nAs **rehype** works on HTML, and improper use of HTML can open you up to a\n[cross-site scripting (XSS)][xss] attack, use of rehype can also be unsafe.\nUse [`rehype-sanitize`][rehype-sanitize] to make the tree safe.\n\nUse of rehype plugins could also open you up to other attacks.\nCarefully assess each plugin and the risks involved in using them.\n\nFor info on how to submit a report, see our [security policy][security].\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`rehypejs/.github`][health] for ways\nto get started.\nSee [`support.md`][support] for ways to get help.\n\nThis project has a [code of conduct][coc].\nBy interacting with this repository, organization, or community you agree to\nabide by its terms.\n\n## Sponsor\n\nSupport this effort and give back by sponsoring on [OpenCollective][collective]!\n\n<table>\n<tr valign=\"middle\">\n<td width=\"20%\" align=\"center\" rowspan=\"2\" colspan=\"2\">\n  <a href=\"https://vercel.com\">Vercel</a><br><br>\n  <a href=\"https://vercel.com\"><img src=\"https://avatars1.githubusercontent.com/u/14985020?s=256&v=4\" width=\"128\"></a>\n</td>\n<td width=\"20%\" align=\"center\" rowspan=\"2\" colspan=\"2\">\n  <a href=\"https://motif.land\">Motif</a><br><br>\n  <a href=\"https://motif.land\"><img src=\"https://avatars1.githubusercontent.com/u/74457950?s=256&v=4\" width=\"128\"></a>\n</td>\n<td width=\"20%\" align=\"center\" rowspan=\"2\" colspan=\"2\">\n  <a href=\"https://www.hashicorp.com\">HashiCorp</a><br><br>\n  <a href=\"https://www.hashicorp.com\"><img src=\"https://avatars1.githubusercontent.com/u/761456?s=256&v=4\" width=\"128\"></a>\n</td>\n<td width=\"20%\" align=\"center\" rowspan=\"2\" colspan=\"2\">\n  <a href=\"https://www.gitbook.com\">GitBook</a><br><br>\n  <a href=\"https://www.gitbook.com\"><img src=\"https://avatars1.githubusercontent.com/u/7111340?s=256&v=4\" width=\"128\"></a>\n</td>\n<td width=\"20%\" align=\"center\" rowspan=\"2\" colspan=\"2\">\n  <a href=\"https://www.gatsbyjs.org\">Gatsby</a><br><br>\n  <a href=\"https://www.gatsbyjs.org\"><img src=\"https://avatars1.githubusercontent.com/u/12551863?s=256&v=4\" width=\"128\"></a>\n</td>\n</tr>\n<tr valign=\"middle\">\n</tr>\n<tr valign=\"middle\">\n<td width=\"20%\" align=\"center\" rowspan=\"2\" colspan=\"2\">\n  <a href=\"https://www.netlify.com\">Netlify</a><br><br>\n  <!--OC has a sharper image-->\n  <a href=\"https://www.netlify.com\"><img src=\"https://images.opencollective.com/netlify/4087de2/logo/256.png\" width=\"128\"></a>\n</td>\n<td width=\"10%\" align=\"center\">\n  <a href=\"https://www.coinbase.com\">Coinbase</a><br><br>\n  <a href=\"https://www.coinbase.com\"><img src=\"https://avatars1.githubusercontent.com/u/1885080?s=256&v=4\" width=\"64\"></a>\n</td>\n<td width=\"10%\" align=\"center\">\n  <a href=\"https://themeisle.com\">ThemeIsle</a><br><br>\n  <a href=\"https://themeisle.com\"><img src=\"https://avatars1.githubusercontent.com/u/58979018?s=128&v=4\" width=\"64\"></a>\n</td>\n<td width=\"10%\" align=\"center\">\n  <a href=\"https://expo.io\">Expo</a><br><br>\n  <a href=\"https://expo.io\"><img src=\"https://avatars1.githubusercontent.com/u/12504344?s=128&v=4\" width=\"64\"></a>\n</td>\n<td width=\"10%\" align=\"center\">\n  <a href=\"https://boostnote.io\">Boost Note</a><br><br>\n  <a href=\"https://boostnote.io\"><img src=\"https://images.opencollective.com/boosthub/6318083/logo/128.png\" width=\"64\"></a>\n</td>\n<td width=\"10%\" align=\"center\">\n  <a href=\"https://markdown.space\">Markdown Space</a><br><br>\n  <a href=\"https://markdown.space\"><img src=\"https://images.opencollective.com/markdown-space/e1038ed/logo/128.png\" width=\"64\"></a>\n</td>\n<td width=\"10%\" align=\"center\">\n  <a href=\"https://www.holloway.com\">Holloway</a><br><br>\n  <a href=\"https://www.holloway.com\"><img src=\"https://avatars1.githubusercontent.com/u/35904294?s=128&v=4\" width=\"64\"></a>\n</td>\n<td width=\"10%\"></td>\n<td width=\"10%\"></td>\n</tr>\n<tr valign=\"middle\">\n<td width=\"100%\" align=\"center\" colspan=\"8\">\n  <br>\n  <a href=\"https://opencollective.com/unified\"><strong>You?</strong></a>\n  <br><br>\n</td>\n</tr>\n</table>\n\n## License\n\n[MIT][license] © [Titus Wormer][author]\n\n<!-- Definitions -->\n\n[build-badge]: https://github.com/rehypejs/rehype/workflows/main/badge.svg\n\n[build]: https://github.com/rehypejs/rehype/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/rehypejs/rehype.svg\n\n[coverage]: https://codecov.io/github/rehypejs/rehype\n\n[downloads-badge]: https://img.shields.io/npm/dm/rehype.svg\n\n[downloads]: https://www.npmjs.com/package/rehype\n\n[size-badge]: https://img.shields.io/bundlejs/size/rehype\n\n[size]: https://bundlejs.com/?q=rehype\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[collective]: https://opencollective.com/unified\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[chat]: https://github.com/rehypejs/rehype/discussions\n\n[health]: https://github.com/rehypejs/.github\n\n[security]: https://github.com/rehypejs/.github/blob/main/security.md\n\n[contributing]: https://github.com/rehypejs/.github/blob/main/contributing.md\n\n[support]: https://github.com/rehypejs/.github/blob/main/support.md\n\n[coc]: https://github.com/rehypejs/.github/blob/main/code-of-conduct.md\n\n[license]: https://github.com/rehypejs/rehype/blob/main/license\n\n[author]: https://wooorm.com\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esmsh]: https://esm.sh\n\n[unified]: https://github.com/unifiedjs/unified\n\n[rehype]: https://github.com/rehypejs/rehype\n\n[hast]: https://github.com/syntax-tree/hast\n\n[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting\n\n[typescript]: https://www.typescriptlang.org\n\n[rehype-parse]: ../rehype-parse/\n\n[rehype-stringify]: ../rehype-stringify/\n\n[rehype-cli]: ../rehype-cli/\n\n[rehype-sanitize]: https://github.com/rehypejs/rehype-sanitize\n\n[rehype-dom]: https://github.com/rehypejs/rehype-dom/tree/main/packages/rehype-dom\n\n[api-rehype]: #rehype-1\n","publish_time":1531861179706,"_cnpm_publish_time":1531861179706,"dist-tags":{"latest":"13.0.2"}}