{"id":13484020,"url":"https://github.com/rehypejs/rehype-raw","last_synced_at":"2026-01-23T09:56:41.255Z","repository":{"id":45221247,"uuid":"71449466","full_name":"rehypejs/rehype-raw","owner":"rehypejs","description":"plugin to parse the tree again","archived":false,"fork":false,"pushed_at":"2024-11-14T16:06:46.000Z","size":131,"stargazers_count":161,"open_issues_count":0,"forks_count":9,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-27T15:48:02.904Z","etag":null,"topics":["html","rehype","rehype-plugin"],"latest_commit_sha":null,"homepage":"https://unifiedjs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rehypejs.png","metadata":{"funding":{"github":"unifiedjs","open_collective":"unified"},"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-20T09:56:10.000Z","updated_at":"2025-03-26T22:57:29.000Z","dependencies_parsed_at":"2024-01-13T18:24:38.346Z","dependency_job_id":"766d7e9d-0a3a-4521-a29a-2c7765fc9763","html_url":"https://github.com/rehypejs/rehype-raw","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/rehypejs/rehype-raw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehypejs%2Frehype-raw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehypejs%2Frehype-raw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehypejs%2Frehype-raw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehypejs%2Frehype-raw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rehypejs","download_url":"https://codeload.github.com/rehypejs/rehype-raw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rehypejs%2Frehype-raw/sbom","scorecard":{"id":769271,"data":{"date":"2025-08-18","repo":{"name":"github.com/rehypejs/rehype-raw","commit":"839c43a2b60ff29b5f1f4ee4758551ca3dd68b6d"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":4.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 2/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":1,"reason":"0 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/bb.yml:1","Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/bb.yml:5: update your workflow using https://app.stepsecurity.io/secureworkflow/rehypejs/rehype-raw/bb.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:6: update your workflow using https://app.stepsecurity.io/secureworkflow/rehypejs/rehype-raw/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:7: update your workflow using https://app.stepsecurity.io/secureworkflow/rehypejs/rehype-raw/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/rehypejs/rehype-raw/main.yml/main?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:11","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned","Info:   0 out of   1 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: license:0","Info: FSF or OSI recognized license: MIT License: license:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/rehypejs/.github/security.md:1","Info: Found linked content: github.com/rehypejs/.github/security.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/rehypejs/.github/security.md:1","Info: Found text in security policy: github.com/rehypejs/.github/security.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 2 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T01:46:59.552Z","repository_id":45221247,"created_at":"2025-08-23T01:46:59.552Z","updated_at":"2025-08-23T01:46:59.552Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28687390,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-23T05:48:07.525Z","status":"ssl_error","status_checked_at":"2026-01-23T05:48:07.129Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["html","rehype","rehype-plugin"],"created_at":"2024-07-31T17:01:18.082Z","updated_at":"2026-01-23T09:56:41.217Z","avatar_url":"https://github.com/rehypejs.png","language":"JavaScript","funding_links":["https://github.com/sponsors/unifiedjs","https://opencollective.com/unified"],"categories":["JavaScript"],"sub_categories":[],"readme":"# rehype-raw\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**[rehype][]** plugin to parse the tree (and raw nodes) again, keeping\npositional info okay.\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  * [`unified().use(rehypeRaw[, options])`](#unifieduserehyperaw-options)\n  * [`Options`](#options)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Security](#security)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package is a [unified][] ([rehype][]) plugin to parse a document again.\nTo understand how it works, requires knowledge of ASTs (specifically, [hast][]).\nThis plugin passes each node and embedded raw HTML through an HTML parser\n([`parse5`][parse5]), to recreate a tree exactly as how a browser would parse\nit, while keeping the original data and positional info intact.\n\n**unified** is a project that transforms content with abstract syntax trees\n(ASTs).\n**rehype** adds support for HTML to unified.\n**hast** is the HTML AST that rehype uses.\nThis is a rehype plugin that parses the tree again.\n\n## When should I use this?\n\nThis plugin is particularly useful when coming from markdown and wanting to\nsupport HTML embedded inside that markdown (which requires passing\n`allowDangerousHtml: true` to `remark-rehype`).\nMarkdown dictates how, say, a list item or emphasis can be parsed.\nWe can use that to turn the markdown syntax tree into an HTML syntax tree.\nBut markdown also dictates that things that look like HTML, are passed through\nuntouched, even when it just looks like XML but doesn’t really make sense, so we\ncan’t normally use these strings of “HTML” to create an HTML syntax tree.\nThis plugin can.\nIt can be used to take those strings of HTML and include them into the syntax\ntree as actual nodes.\n\nIf your final result is HTML and you trust content, then “strings” are fine\n(you can pass `allowDangerousHtml: true` to `rehype-stringify`, which passes\nHTML through untouched).\nBut there are two main cases where a proper syntax tree is preferred:\n\n* rehype plugins need a proper syntax tree as they operate on actual nodes to\n  inspect or transform things, they can’t operate on strings of HTML\n* other output formats (React, MDX, etc) need actual nodes and can’t handle\n  strings of HTML\n\nThis plugin is built on [`hast-util-raw`][hast-util-raw], which does the work on\nsyntax trees.\nrehype focusses on making it easier to transform content by abstracting such\ninternals away.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install rehype-raw\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport rehypeRaw from 'https://esm.sh/rehype-raw@7'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n\u003cscript type=\"module\"\u003e\n  import rehypeRaw from 'https://esm.sh/rehype-raw@7?bundle'\n\u003c/script\u003e\n```\n\n## Use\n\nSay we have the following markdown file `example.md`:\n\n```markdown\n\u003cdiv class=\"note\"\u003e\n\nA mix of *markdown* and \u003cem\u003eHTML\u003c/em\u003e.\n\n\u003c/div\u003e\n```\n\n…and our module `example.js` looks as follows:\n\n```js\nimport rehypeDocument from 'rehype-document'\nimport rehypeFormat from 'rehype-format'\nimport rehypeRaw from 'rehype-raw'\nimport rehypeStringify from 'rehype-stringify'\nimport remarkParse from 'remark-parse'\nimport remarkRehype from 'remark-rehype'\nimport {read} from 'to-vfile'\nimport {unified} from 'unified'\n\nconst file = await unified()\n  .use(remarkParse)\n  .use(remarkRehype, {allowDangerousHtml: true})\n  .use(rehypeRaw)\n  .use(rehypeDocument, {title: '🙌'})\n  .use(rehypeFormat)\n  .use(rehypeStringify)\n  .process(await read('example.md'))\n\nconsole.log(String(file))\n```\n\n…now running `node example.js` yields:\n\n```html\n\u003c!doctype html\u003e\n\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003ctitle\u003e🙌\u003c/title\u003e\n    \u003cmeta name=\"viewport\" content=\"width=device-width, initial-scale=1\"\u003e\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv class=\"note\"\u003e\n      \u003cp\u003eA mix of \u003cem\u003emarkdown\u003c/em\u003e and \u003cem\u003eHTML\u003c/em\u003e.\u003c/p\u003e\n    \u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n## API\n\nThis package exports no identifiers.\nThe default export is [`rehypeRaw`][api-rehype-raw].\n\n### `unified().use(rehypeRaw[, options])`\n\nParse the tree (and raw nodes) again, keeping positional info okay.\n\n###### Parameters\n\n* `options` ([`Options`][api-options], optional)\n  — configuration\n\n###### Returns\n\nTransform ([`Transformer`][transformer]).\n\n### `Options`\n\nConfiguration (TypeScript type).\n\n###### Fields\n\n* `passThrough` (`Array\u003cstring\u003e`, default: `[]`)\n  — list of custom hast node types to pass through (as in, keep); this option\n  is a bit advanced as it requires knowledge of ASTs, so we defer to the docs\n  in [`hast-util-raw`][hast-util-raw]\n* `tagfilter?` (`boolean | null | undefined`)\n  — whether to disallow irregular tags in `raw` nodes according to GFM\n  tagfilter (default: `false`);\n  this affects the following tags,\n  grouped by their kind:\n  `RAWTEXT` (`iframe`, `noembed`, `noframes`, `style`, `xmp`),\n  `RCDATA` (`textarea`, `title`),\n  `SCRIPT_DATA` (`script`),\n  `PLAINTEXT` (`plaintext`);\n  when you know that you do not want authors to write these tags,\n  you can enable this option to prevent their use from running amok.\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt exports the additional type [`Options`][api-options].\n\nThe `Raw` node type is registered by and exposed from\n[`remark-rehype`][remark-rehype].\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-raw@^7`, compatible\nwith Node.js 16.\n\n## Security\n\nThe `allowDangerousHtml` option in [`remark-rehype`][remark-rehype] is\ndangerous, so see that plugin on how to make it safe.\nOtherwise, this plugin is safe.\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## License\n\n[MIT][license] © [Titus Wormer][author]\n\n\u003c!-- Definitions --\u003e\n\n[build-badge]: https://github.com/rehypejs/rehype-raw/workflows/main/badge.svg\n\n[build]: https://github.com/rehypejs/rehype-raw/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/rehypejs/rehype-raw.svg\n\n[coverage]: https://codecov.io/github/rehypejs/rehype-raw\n\n[downloads-badge]: https://img.shields.io/npm/dm/rehype-raw.svg\n\n[downloads]: https://www.npmjs.com/package/rehype-raw\n\n[size-badge]: https://img.shields.io/bundlejs/size/rehype-raw\n\n[size]: https://bundlejs.com/?q=rehype-raw\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[npm]: https://docs.npmjs.com/cli/install\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[health]: https://github.com/rehypejs/.github\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]: license\n\n[author]: https://wooorm.com\n\n[typescript]: https://www.typescriptlang.org\n\n[parse5]: https://github.com/inikulin/parse5\n\n[unified]: https://github.com/unifiedjs/unified\n\n[transformer]: https://github.com/unifiedjs/unified#transformer\n\n[hast]: https://github.com/syntax-tree/hast\n\n[hast-util-raw]: https://github.com/syntax-tree/hast-util-raw\n\n[rehype]: https://github.com/rehypejs/rehype\n\n[remark-rehype]: https://github.com/remarkjs/remark-rehype\n\n[api-options]: #options\n\n[api-rehype-raw]: #unifieduserehyperaw-options\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frehypejs%2Frehype-raw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frehypejs%2Frehype-raw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frehypejs%2Frehype-raw/lists"}