{"_id":"mdast-util-gfm-strikethrough@2.0.1","bugs":{"url":"https://github.com/syntax-tree/mdast-util-gfm-strikethrough/issues"},"dist":{"shasum":"96c7a4924cf5342acb6aefc4cd7893419ac816e8","tarball":"http://registry-npm.ywwl.com/mdast-util-gfm-strikethrough/download/mdast-util-gfm-strikethrough-2.0.1.tgz","fileCount":8,"integrity":"sha512-OuJHqvr455pwu2OaOrir7dbzqs4jlWKOtlu9L6GjcIjjQwNyw02VntQsr/Ek6/A13vgnXfUhBekWRUP1OkNivw==","signatures":[{"sig":"MEUCIQCb7ZmzBbxqenxcLqnI3t/HjLixqXBjzaLwyXy+xiYMwgIgDmH8uz+iQUGCePye890Cls30QYA8zWps5pOC7KmeWSc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE1nZfF/1Jcs6+Vqgs6suizYsh2mCuyyaOIA4mV+LbNlAiEA6/OxjhFFooGGO6l8i6ffeGk7LwAPEvFNDJNEsgw1fBI="}],"unpackedSize":17849,"size":5944,"noattachment":false,"key":"/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.1.tgz"},"name":"mdast-util-gfm-strikethrough","type":"module","types":"./index.d.ts","author":{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"},"exports":"./index.js","funding":{"url":"https://opencollective.com/unified","type":"opencollective"},"gitHead":"ecb120033eb878ff8862b7d3902a69ad064b9456","license":"MIT","scripts":{"test":"npm run build && npm run format && npm run test-coverage","build":"tsc --build --clean && tsc --build && type-coverage","format":"remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix","prepack":"npm run build && npm run format","test-api":"npm run test-api-dev && npm run test-api-prod","test-api-dev":"node --conditions development test.js","test-api-prod":"node --conditions production test.js","test-coverage":"c8 --100 --reporter lcov -- npm run test-api"},"version":"2.0.1","_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"homepage":"https://github.com/syntax-tree/mdast-util-gfm-strikethrough#readme","keywords":["delete","deletion","del","gfm","markdown","markup","mdast-util","mdast","strikethrough","strike","through","unist","utility","util"],"prettier":{"semi":false,"useTabs":false,"tabWidth":2,"singleQuote":true,"trailingComma":"none","bracketSpacing":false},"repository":{"url":"git+https://github.com/syntax-tree/mdast-util-gfm-strikethrough.git","type":"git"},"_npmVersion":"12.0.2","description":"mdast extension to parse and serialize GFM strikethrough","directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"},{"name":"kmck","email":"keith@mcknig.ht"}],"sideEffects":false,"_nodeVersion":"26.3.0","contributors":[{"url":"https://wooorm.com","name":"Titus Wormer","email":"tituswormer@gmail.com"}],"dependencies":{"@types/mdast":"^4.0.0","mdast-util-to-markdown":"^2.0.0","mdast-util-from-markdown":"^2.0.0"},"remarkConfig":{"plugins":["remark-preset-wooorm"]},"typeCoverage":{"strict":true,"atLeast":100},"_hasShrinkwrap":false,"devDependencies":{"c8":"^12.0.0","xo":"^5.0.0","prettier":"^3.0.0","remark-cli":"^12.0.0","typescript":"^6.0.0","@types/node":"^26.0.0","type-coverage":"^2.0.0","remark-preset-wooorm":"^11.0.0","unist-util-remove-position":"^5.0.0","micromark-extension-gfm-strikethrough":"^2.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mdast-util-gfm-strikethrough_2.0.1_1790519565372_0.457812955078567"},"readme":"# mdast-util-gfm-strikethrough\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[mdast][] extensions to parse and serialize [GFM][] strikethrough.\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  * [`gfmStrikethroughFromMarkdown()`](#gfmstrikethroughfrommarkdown)\n  * [`gfmStrikethroughToMarkdown()`](#gfmstrikethroughtomarkdown)\n* [HTML](#html)\n* [Syntax](#syntax)\n* [Syntax tree](#syntax-tree)\n  * [Nodes](#nodes)\n  * [Content model](#content-model)\n* [Types](#types)\n* [Compatibility](#compatibility)\n* [Related](#related)\n* [Contribute](#contribute)\n* [License](#license)\n\n## What is this?\n\nThis package contains two extensions that add support for GFM strikethrough\nsyntax in markdown to [mdast][].\nThese extensions plug into\n[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing\nstrikethrough in markdown into a syntax tree) and\n[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing\nstrikethrough in syntax trees to markdown).\n\n## When to use this\n\nYou can use these extensions when you are working with\n`mdast-util-from-markdown` and `mdast-util-to-markdown` already.\n\nWhen working with `mdast-util-from-markdown`, you must combine this package\nwith [`micromark-extension-gfm-strikethrough`][extension].\n\nWhen you don’t need a syntax tree, you can use [`micromark`][micromark]\ndirectly with `micromark-extension-gfm-strikethrough`.\n\nWhen you are working with syntax trees and want all of GFM, use\n[`mdast-util-gfm`][mdast-util-gfm] instead.\n\nAll these packages are used [`remark-gfm`][remark-gfm], which\nfocusses on making it easier to transform content by abstracting these\ninternals away.\n\nThis utility does not handle how markdown is turned to HTML.\nThat’s done by [`mdast-util-to-hast`][mdast-util-to-hast].\nIf you want a different element, you should configure that utility.\n\n## Install\n\nThis package is [ESM only][esm].\nIn Node.js (version 16+), install with [npm][]:\n\n```sh\nnpm install mdast-util-gfm-strikethrough\n```\n\nIn Deno with [`esm.sh`][esmsh]:\n\n```js\nimport {gfmStrikethroughFromMarkdown, gfmStrikethroughToMarkdown} from 'https://esm.sh/mdast-util-gfm-strikethrough@2'\n```\n\nIn browsers with [`esm.sh`][esmsh]:\n\n```html\n<script type=\"module\">\n  import {gfmStrikethroughFromMarkdown, gfmStrikethroughToMarkdown} from 'https://esm.sh/mdast-util-gfm-strikethrough@2?bundle'\n</script>\n```\n\n## Use\n\nSay our document `example.md` contains:\n\n```markdown\n*Emphasis*, **importance**, and ~~strikethrough~~.\n```\n\n…and our module `example.js` looks as follows:\n\n```js\nimport fs from 'node:fs/promises'\nimport {gfmStrikethrough} from 'micromark-extension-gfm-strikethrough'\nimport {fromMarkdown} from 'mdast-util-from-markdown'\nimport {gfmStrikethroughFromMarkdown, gfmStrikethroughToMarkdown} from 'mdast-util-gfm-strikethrough'\nimport {toMarkdown} from 'mdast-util-to-markdown'\n\nconst doc = await fs.readFile('example.md')\n\nconst tree = fromMarkdown(doc, {\n  extensions: [gfmStrikethrough()],\n  mdastExtensions: [gfmStrikethroughFromMarkdown()]\n})\n\nconsole.log(tree)\n\nconst out = toMarkdown(tree, {extensions: [gfmStrikethroughToMarkdown()]})\n\nconsole.log(out)\n```\n\nNow, running `node example` yields:\n\n```js\n{\n  type: 'root',\n  children: [\n    {\n      type: 'paragraph',\n      children: [\n        {type: 'emphasis', children: [{type: 'text', value: 'Emphasis'}]},\n        {type: 'text', value: ', '},\n        {type: 'strong', children: [{type: 'text', value: 'importance'}]},\n        {type: 'text', value: ', and '},\n        {type: 'delete', children: [{type: 'text', value: 'strikethrough'}]},\n        {type: 'text', value: '.'}\n      ]\n    }\n  ]\n}\n```\n\n```markdown\n*Emphasis*, **importance**, and ~~strikethrough~~.\n```\n\n## API\n\nThis package exports the identifiers\n[`gfmStrikethroughFromMarkdown`][api-gfm-strikethrough-from-markdown] and\n[`gfmStrikethroughToMarkdown`][api-gfm-strikethrough-to-markdown].\nThere is no default export.\n\n### `gfmStrikethroughFromMarkdown()`\n\nCreate an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown]\nto enable GFM strikethrough in markdown.\n\n###### Returns\n\nExtension for `mdast-util-from-markdown` to enable GFM strikethrough\n([`FromMarkdownExtension`][from-markdown-extension]).\n\n### `gfmStrikethroughToMarkdown()`\n\nCreate an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown] to\nenable GFM strikethrough in markdown.\n\n###### Returns\n\nExtension for `mdast-util-to-markdown` to enable GFM strikethrough\n([`ToMarkdownExtension`][to-markdown-extension]).\n\n## HTML\n\nThis utility does not handle how markdown is turned to HTML.\nThat’s done by [`mdast-util-to-hast`][mdast-util-to-hast].\nIf you want a different element, you should configure that utility.\n\n## Syntax\n\nSee [Syntax in `micromark-extension-gfm-strikethrough`][syntax].\n\n## Syntax tree\n\nThe following interfaces are added to **[mdast][]** by this utility.\n\n### Nodes\n\n#### `Delete`\n\n```idl\ninterface Delete <: Parent {\n  type: 'delete'\n  children: [TransparentContent]\n}\n```\n\n**Delete** (**[Parent][dfn-parent]**) represents contents that are no longer\naccurate or no longer relevant.\n\n**Delete** can be used where **[phrasing][dfn-phrasing-content]**\ncontent is expected.\nIts content model is **[transparent][dfn-transparent-content]** content.\n\nFor example, the following markdown:\n\n```markdown\n~~alpha~~\n```\n\nYields:\n\n```js\n{\n  type: 'delete',\n  children: [{type: 'text', value: 'alpha'}]\n}\n```\n\n### Content model\n\n#### `PhrasingContent` (GFM strikethrough)\n\n```idl\ntype PhrasingContentGfm = Delete | PhrasingContent\n```\n\n## Types\n\nThis package is fully typed with [TypeScript][].\nIt does not export additional types.\n\nThe `Delete` type of the mdast node is exposed from `@types/mdast`.\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`mdast-util-gfm-strikethrough@^2`, compatible with Node.js 16.\n\nThis utility works with `mdast-util-from-markdown` version 2+ and\n`mdast-util-to-markdown` version 2+.\n\n## Related\n\n* [`remarkjs/remark-gfm`][remark-gfm]\n  — remark plugin to support GFM\n* [`syntax-tree/mdast-util-gfm`][mdast-util-gfm]\n  — same but all of GFM (autolink literals, footnotes, strikethrough, tables,\n  tasklists)\n* [`micromark/micromark-extension-gfm-strikethrough`][extension]\n  — micromark extension to parse GFM strikethrough\n\n## Contribute\n\nSee [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for\nways to 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<!-- Definitions -->\n\n[api-gfm-strikethrough-from-markdown]: #gfmstrikethroughfrommarkdown\n\n[api-gfm-strikethrough-to-markdown]: #gfmstrikethroughtomarkdown\n\n[author]: https://wooorm.com\n\n[backers-badge]: https://opencollective.com/unified/backers/badge.svg\n\n[build]: https://github.com/syntax-tree/mdast-util-gfm-strikethrough/actions\n\n[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-strikethrough/workflows/main/badge.svg\n\n[chat]: https://github.com/syntax-tree/unist/discussions\n\n[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[collective]: https://opencollective.com/unified\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-strikethrough\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-strikethrough.svg\n\n[dfn-parent]: https://github.com/syntax-tree/mdast#parent\n\n[dfn-phrasing-content]: #phrasingcontent-gfm-strikethrough\n\n[dfn-transparent-content]: https://github.com/syntax-tree/mdast#transparentcontent\n\n[downloads]: https://www.npmjs.com/package/mdast-util-gfm-strikethrough\n\n[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-strikethrough.svg\n\n[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c\n\n[esmsh]: https://esm.sh\n\n[extension]: https://github.com/micromark/micromark-extension-gfm-strikethrough\n\n[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension\n\n[gfm]: https://github.github.com/gfm/\n\n[health]: https://github.com/syntax-tree/.github\n\n[license]: license\n\n[mdast]: https://github.com/syntax-tree/mdast\n\n[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown\n\n[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm\n\n[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast\n\n[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown\n\n[micromark]: https://github.com/micromark/micromark\n\n[npm]: https://docs.npmjs.com/cli/install\n\n[remark-gfm]: https://github.com/remarkjs/remark-gfm\n\n[size]: https://bundlejs.com/?q=mdast-util-gfm-strikethrough\n\n[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-strikethrough\n\n[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[syntax]: https://github.com/micromark/micromark-extension-gfm-strikethrough#syntax\n\n[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options\n\n[typescript]: https://www.typescriptlang.org\n","publish_time":1790519565456,"_cnpm_publish_time":1790519565456,"dist-tags":{"latest":"2.0.1"}}