{"name":"mdast-util-gfm-strikethrough","version":"1.0.0","description":"mdast extension to parse and serialize GFM strikethrough","license":"MIT","keywords":["unist","mdast","mdast-util","util","utility","markdown","markup","strikethrough","strike","through","del","delete","deletion","gfm"],"repository":{"type":"git","url":"git+https://github.com/syntax-tree/mdast-util-gfm-strikethrough.git"},"bugs":{"url":"https://github.com/syntax-tree/mdast-util-gfm-strikethrough/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","main":"index.js","types":"index.d.ts","dependencies":{"@types/mdast":"^3.0.3","mdast-util-to-markdown":"^1.0.0"},"devDependencies":{"@types/tape":"^4.0.0","c8":"^7.0.0","mdast-util-from-markdown":"^1.0.0","micromark-extension-gfm-strikethrough":"^1.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0","remark-preset-wooorm":"^8.0.0","rimraf":"^3.0.2","tape":"^5.0.0","type-coverage":"^2.17.5","typescript":"^4.3.4","unist-util-remove-position":"^4.0.0","xo":"^0.39.0"},"scripts":{"build":"rimraf \"*.d.ts\" && tsc && type-coverage","format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node --conditions development test.js","test-coverage":"c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov node --conditions development test.js","test":"npm run build && npm run format && npm run test-coverage"},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true},"remarkConfig":{"plugins":["preset-wooorm"]},"typeCoverage":{"atLeast":100,"detail":true,"strict":true,"ignoreCatch":true},"gitHead":"681c22b32b4da2797cba90c529bad16580d8ce0e","homepage":"https://github.com/syntax-tree/mdast-util-gfm-strikethrough#readme","_id":"mdast-util-gfm-strikethrough@1.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.18.1","dist":{"integrity":"sha512-gM9ipBUdRxYa6Yq1Hd8Otg6jEn/dRxFZ1F9ZX4QHosHOexLGqNZO2dh0A+YFbUEd10RcKjnjb4jOfJJzoXXUew==","shasum":"6cc72ef5d9539f4cee76af3f15dd0daa9e3af40f","tarball":"http://registry-npm.ywwl.com/mdast-util-gfm-strikethrough/download/mdast-util-gfm-strikethrough-1.0.0.tgz","fileCount":5,"unpackedSize":10758,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg0lBHCRA9TVsSAnZWagAAMTkP/0zTqyQMBPweiA9EIESa\nMkP9B/RzpBZ9I3OW+w0HRVHBUR3Qb3ydmjfZr0e5UZIZPzyc8D3TMmYtgMky\n1X2FGQPafWSsfuBbpx7OhbIHCFKTVWukUCjvRt0vuK7QfgDFKyF8ZIu/KPbh\nRgwrJbVIqZBtrRNen3d9WlclK54/cxjvx/RiwVG+glwObbEeR/NyUI3Q7MZj\nh7n/QHvVoIwQCRBQ4VfUxU+XdsYoDotvExqRuy19E4IIHAazacpF03sQsPKs\n05xWxjfKLAcDzI+yJv2/TdU0K8haKQ57uwvyrpgitjnTNKnSOqWaWHuMDYPP\n1p5noa5fudOBWWyoHrQiYFLHzFmjysYlZ0XMLxR1pky1/LgvGEqitYroO4OJ\nS91iqxkRX0iSVnQMpS7NdocXzHy+6nR7hJPz8JQnG2kGjfCXX/iBDzaGlhvA\n9eKdCa2CtFyEpGNBIlCkQ50xoNYHcIV6dctWBePIYUibJ3tg3kqZR7ZLv5y6\nrRbvRxLxElUFiDyVQeJfs/o5vbdeTeQFKufraD8D/ShGKk9qj6exbXPhzqUS\npF/Yh7CT/pVLwR/tuyya//JMkkwi5rJ9MAl9xwA+Qleb1dNNebta0KYjDRYK\nlchL79qNEeu1PWtL4gX+IZXfvOH1ltV9kej6nKjHXkMx17ZzF7Z5krn/qS9z\npqb6\r\n=SS9R\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQHZs3EZUL6jkCmsaW9mdo4WWXSv0gpIb8uDTUuEXVJwIhAJqzYcvW3U2Rwb+B85Zn9AMDZzfmWazgDrzx7ISWhB0M"}],"size":3880,"noattachment":false,"key":"/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.0.tgz"},"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"maintainers":[{"name":"wooorm","email":"tituswormer@gmail.com"},{"name":"kmck","email":"keith@mcknig.ht"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mdast-util-gfm-strikethrough_1.0.0_1624395847464_0.6621852665504588"},"_hasShrinkwrap":false,"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[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-strikethrough/workflows/main/badge.svg\n\n[build]: https://github.com/syntax-tree/mdast-util-gfm-strikethrough/actions\n\n[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-strikethrough.svg\n\n[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-strikethrough\n\n[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-strikethrough.svg\n\n[downloads]: https://www.npmjs.com/package/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[size]: https://bundlejs.com/?q=mdast-util-gfm-strikethrough\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/syntax-tree/unist/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[typescript]: https://www.typescriptlang.org\n\n[license]: license\n\n[author]: https://wooorm.com\n\n[health]: https://github.com/syntax-tree/.github\n\n[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md\n\n[support]: https://github.com/syntax-tree/.github/blob/main/support.md\n\n[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md\n\n[gfm]: https://github.github.com/gfm/\n\n[remark-gfm]: https://github.com/remarkjs/remark-gfm\n\n[mdast]: https://github.com/syntax-tree/mdast\n\n[dfn-transparent-content]: https://github.com/syntax-tree/mdast#transparentcontent\n\n[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown\n\n[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension\n\n[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown\n\n[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options\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[micromark]: https://github.com/micromark/micromark\n\n[extension]: https://github.com/micromark/micromark-extension-gfm-strikethrough\n\n[syntax]: https://github.com/micromark/micromark-extension-gfm-strikethrough#syntax\n\n[dfn-parent]: https://github.com/syntax-tree/mdast#parent\n\n[dfn-phrasing-content]: #phrasingcontent-gfm-strikethrough\n\n[api-gfm-strikethrough-from-markdown]: #gfmstrikethroughfrommarkdown\n\n[api-gfm-strikethrough-to-markdown]: #gfmstrikethroughtomarkdown\n","publish_time":1624395847575,"_cnpm_publish_time":1624395847575,"dist-tags":{"latest":"2.0.1"}}