{"name":"mdast-util-gfm-strikethrough","version":"0.2.2","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"}],"dependencies":{"mdast-util-to-markdown":"^0.5.0"},"devDependencies":{"mdast-util-from-markdown":"^0.8.0","micromark-extension-gfm-strikethrough":"^0.6.0","nyc":"^15.0.0","prettier":"^2.0.0","remark-cli":"^9.0.0-alpha.1","remark-preset-wooorm":"^8.0.0","tape":"^5.0.0","unist-util-remove-position":"^3.0.0","xo":"^0.33.0"},"scripts":{"format":"remark . -qfo && prettier . -w --loglevel warn && xo --fix","test-api":"node test","test-coverage":"nyc --reporter lcov tape test.js","test":"npm run format && npm run test-coverage"},"nyc":{"check-coverage":true,"lines":100,"functions":100,"branches":100},"prettier":{"tabWidth":2,"useTabs":false,"singleQuote":true,"bracketSpacing":false,"semi":false,"trailingComma":"none"},"xo":{"prettier":true,"esnext":false},"remarkConfig":{"plugins":["preset-wooorm"]},"gitHead":"dffc6ed07c36384173afe35258a44b318eb3185a","homepage":"https://github.com/syntax-tree/mdast-util-gfm-strikethrough#readme","_id":"mdast-util-gfm-strikethrough@0.2.2","_nodeVersion":"14.13.1","_npmVersion":"6.14.8","dist":{"integrity":"sha512-T37ZbaokJcRbHROXmoVAieWnesPD5N21tv2ifYzaGRLbkh1gknItUGhZzHefUn5Zc/eaO/iTDSAFOBrn/E8kWw==","shasum":"6e9ddd33ce41b06a60463e817f6ef4cf7bfa0655","tarball":"http://registry-npm.ywwl.com/mdast-util-gfm-strikethrough/download/mdast-util-gfm-strikethrough-0.2.2.tgz","fileCount":6,"unpackedSize":8857,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfhdMFCRA9TVsSAnZWagAA7OAQAJkur1bxD0GUnePFiDsI\nTq7rnyGmLRZML76Jf+/SH2uYxAPvzdjCwx0OdwCjJFNoK6LUwGnwvnd+2/DM\n361eHx3CtWqS5ToApfiCCCJZI3BNkZqoi9DgK651OSFrJVBfm2DaDlE85Gy1\nl1rq/0BIxEsMf4BZ2/jg3wv7a0DEhgfszwY/y+4KMZa8OYDYU+EKjNU5kpO0\nrYTjpRiPajZXhVh6+7N9is4Wf55hZ3PzOZGHy/sJSDFoql1ZV3mt96GG0zdL\n79+0oB76lyYUPKRdyh9SwDukPhjUjvlsYgjdwVcbhj5O6YlY39g85TtoiRtQ\nIeBX5t5IXmzuY/sg/YnJwk53bSoGLMZpBCVSfVRnKzsjiLy9G5tmPnFOmgir\n+hC6rttFxDBkSWHgiumKdm49Rjy9VOBWZibF/apIg60CTU8L6axVDd20GHRO\nqsJx+TprF3jvm6bzmtshERs+mHuIifJk6K6XQ0J6aSFaCeFYn16IqgJG9xL3\nK3D1Ih3aEbyVGcwRD90oeimJMQu/wUBgxm0WK7JYWbC252PI5MgH9oMEmELG\nsnr7zV6QZzFcDBWXg6LDhA77hUh/S6DsjK+JEzdQrvzZV5l/rS1k1XScgYwn\niFGNtN42vZu6l9IUsuz1tn2A1GCp2HXiX0DEkDvijntUDfhg3OGpYMhFyMYn\nCjsc\r\n=E3+g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC6IvtFzC3SyZ7v4y1mgKOLwf+eJyS9iKszvxU3KxQYbgIgXeYBiTlXh0qDt+nNjKUgwOqBEUOZl0I9zm9tIx4d3SA="}],"size":3441,"noattachment":false,"key":"/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.2.tgz"},"maintainers":[{"name":"kmck","email":"keith@mcknig.ht"},{"name":"wooorm","email":"tituswormer@gmail.com"}],"_npmUser":{"name":"wooorm","email":"tituswormer@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mdast-util-gfm-strikethrough_0.2.2_1602605828559_0.27576973370849966"},"_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":1602605828668,"_cnpm_publish_time":1602605828668,"dist-tags":{"latest":"2.0.1"}}