{"name":"micromark-extension-gfm-tagfilter","version":"2.0.0","description":"micromark extension to support GFM tagfilter","license":"MIT","keywords":["micromark","micromark-extension","tagfilter","tag","filter","dangerous","html","gfm","markdown","unified"],"repository":{"type":"git","url":"git+https://github.com/micromark/micromark-extension-gfm-tagfilter.git"},"bugs":{"url":"https://github.com/micromark/micromark-extension-gfm-tagfilter/issues"},"funding":{"type":"opencollective","url":"https://opencollective.com/unified"},"author":{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"},"contributors":[{"name":"Titus Wormer","email":"tituswormer@gmail.com","url":"https://wooorm.com"}],"sideEffects":false,"type":"module","exports":"./index.js","dependencies":{"micromark-util-types":"^2.0.0"},"devDependencies":{"@types/node":"^20.0.0","c8":"^8.0.0","micromark":"^4.0.0","prettier":"^2.0.0","remark-cli":"^11.0.0","remark-preset-wooorm":"^9.0.0","type-coverage":"^2.0.0","typescript":"^5.0.0","xo":"^0.54.0"},"scripts":{"prepack":"npm run build && npm run format","build":"tsc --build --clean && tsc --build && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api-prod":"node --conditions production test/index.js","test-api-dev":"node --conditions development test/index.js","test-api":"npm run test-api-dev && npm run test-api-prod","test-coverage":"c8 --100 --reporter lcov npm run test-api","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"bracketSpacing":false,"semi":false,"singleQuote":true,"tabWidth":2,"trailingComma":"none","useTabs":false},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"ignoreCatch":true,"strict":true},"xo":{"prettier":true},"types":"./index.d.ts","gitHead":"a5309cf90b76c0567398880bdfb3c9e62e4a9c20","homepage":"https://github.com/micromark/micromark-extension-gfm-tagfilter#readme","_id":"micromark-extension-gfm-tagfilter@2.0.0","_nodeVersion":"20.0.0","_npmVersion":"9.6.4","dist":{"integrity":"sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==","shasum":"f26d8a7807b5985fba13cf61465b58ca5ff7dc57","tarball":"http://registry-npm.ywwl.com/micromark-extension-gfm-tagfilter/download/micromark-extension-gfm-tagfilter-2.0.0.tgz","fileCount":7,"unpackedSize":11960,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbM/azQsAoOZTF/PcwnEfnZH6WEvGgqZDV78+YWp/QcAIgGzgp17MeIv8A78Y7pg3k3f/gdtwiUo11/NCSwEc56qs="}],"size":4513,"noattachment":false,"key":"/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/micromark-extension-gfm-tagfilter_2.0.0_1687518035063_0.6612606455736403"},"_hasShrinkwrap":false,"readme":"# micromark-extension-gfm-tagfilter\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[micromark][] extension to support GFM [tag filter][].\n\n## Contents\n\n*   [What is this?](#what-is-this)\n*   [When to use this](#when-to-use-this)\n*   [Install](#install)\n*   [Use](#use)\n*   [API](#api)\n    *   [`gfmTagfilterHtml()`](#gfmtagfilterhtml)\n*   [Authoring](#authoring)\n*   [HTML](#html)\n*   [CSS](#css)\n*   [Syntax](#syntax)\n*   [Types](#types)\n*   [Compatibility](#compatibility)\n*   [Security](#security)\n*   [Related](#related)\n*   [Contribute](#contribute)\n*   [License](#license)\n\n## What is this?\n\nThis package contains an extension that adds support for the tagfilter enabled\nby GFM to [`micromark`][micromark].\nThe tagfilter is kinda weird and kinda useless.\nThis package exists for completeness.\nThe tag filter is a naïve attempt at XSS protection.\nYou should use a proper HTML sanitizing algorithm.\n\n## When to use this\n\nThis project is useful when you want to match how GitHub works.\nYou can use this extension when you are working with [`micromark`][micromark]\nalready.\nWhen you do, you can instead use\n[`micromark-extension-gfm`][micromark-extension-gfm], which includes this\nextension, to support all GFM features.\n\nWhen you want to deal with syntax trees, you should instead use\n[`hast-util-sanitize`][hast-util-sanitize].\n\nWhen you use remark and rehype, you should use\n[`rehype-sanitize`][rehype-sanitize].\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install micromark-extension-gfm-tagfilter\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {gfmTagfilterHtml} from 'https://esm.sh/micromark-extension-gfm-tagfilter@2'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {gfmTagfilterHtml} from 'https://esm.sh/micromark-extension-gfm-tagfilter@2?bundle'\n</script>\n```\n\n## Use\n\n```js\nimport {micromark} from 'micromark'\nimport {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'\n\nconst output = micromark('XSS! <script>alert(1)</script>', {\n  allowDangerousHtml: true,\n  htmlExtensions: [gfmTagfilterHtml()]\n})\n\nconsole.log(output)\n```\n\nYields:\n\n```html\n<p>XSS! &lt;script>alert(1)&lt;/script></p>\n```\n\n## API\n\nThis package exports the identifier\n[`gfmTagfilterHtml`][api-gfm-tagfilter-html].\nThere is no default export.\n\n### `gfmTagfilterHtml()`\n\nCreate an HTML extension for `micromark` to support GitHubs weird and\nuseless tagfilter when serializing to HTML.\n\n###### Returns\n\nExtension for `micromark` that can be passed in `htmlExtensions` to support\nGitHubs weird and useless tagfilter when serializing to HTML\n([`HtmlExtension`][micromark-html-extension]).\n\n## Authoring\n\nThis package relates to malicious authors, not decent authors.\n\n## HTML\n\nGFM tagfilter removes certain dangerous HTML tags: `iframe`, `noembed`,\n`noframes`, `plaintext`, `script`, `style`, `title`, `textarea`, and `xmp`.\n\n## CSS\n\nThis package does not relate to CSS.\n\n## Syntax\n\nThis package does not change how markdown is parsed.\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,\n`micromark-extension-gfm-tagfilter@^2`, compatible with Node.js 16.\n\nThis package works with `micromark` version `3` and later.\n\n## Security\n\nWhile micromark is safe by default, this extension only does something when\n`allowDangerousHtml: true` is passed, which is an unsafe option.\nThis package is **not safe**.\n\n## Related\n\n*   [`micromark-extension-gfm`][micromark-extension-gfm]\n    — support all of GFM\n*   [`hast-util-sanitize`][hast-util-sanitize]\n    — hast utility to make trees safe\n*   [`rehype-sanitize`][rehype-sanitize]\n    — rehype plugin to sanitize HTML\n\n## Contribute\n\nSee [`contributing.md` in `micromark/.github`][contributing] for ways to get\nstarted.\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<!-- Definitions -->\n\n[build-badge]: https://github.com/micromark/micromark-extension-gfm-tagfilter/workflows/main/badge.svg\n\n[build]: https://github.com/micromark/micromark-extension-gfm-tagfilter/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-tagfilter.svg\n\n[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-tagfilter\n\n[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-tagfilter.svg\n\n[downloads]: https://www.npmjs.com/package/micromark-extension-gfm-tagfilter\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-tagfilter\n\n[size]: https://bundlejs.com/?q=micromark-extension-gfm-tagfilter\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/micromark/micromark/discussions\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[esmsh]: https://esm.sh\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[contributing]: https://github.com/micromark/.github/blob/main/contributing.md\n\n[support]: https://github.com/micromark/.github/blob/main/support.md\n\n[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[typescript]: https://www.typescriptlang.org\n\n[micromark]: https://github.com/micromark/micromark\n\n[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension\n\n[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm\n\n[rehype-sanitize]: https://github.com/rehypejs/rehype-sanitize\n\n[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize\n\n[tag filter]: https://github.github.com/gfm/#disallowed-raw-html-extension-\n\n[api-gfm-tagfilter-html]: #gfmtagfilterhtml\n","publish_time":1687518035241,"_cnpm_publish_time":1687518035241,"dist-tags":{"latest":"2.0.0"}}