JSPM

@saeris/remark-del

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q68518F
  • License MIT

Remark plugin to add HTML <del> element syntax in markdown

Package Exports

  • @saeris/remark-del
  • @saeris/remark-del/package.json

Readme

➖ remark-del Build Status npm

A unified / remark plugin which adds syntax support for the HTML <del> element in markdown.

📦 Installation

[!Note]

This library is distributed only as an ESM module.

npm install @saeris/remark-del

or

yarn add @saeris/remark-del

🔧 Usage

Using this library will depend on your particular application or framework. Below is a bare-bones example to test it in Node.

Node:

import remark from "remark";
import remarkParse from "remark-parse";
import remarkDel from "@saeris/remark-del";
import remarkRehype from "remark-rehype";
import rehypeStringify from "rehype-stringify";

const markdown = `--deleted text--`

const result = await remark()
  .use(remarkParse)
  .use(remarkDel)
  .use(remarkRehype)
  .use(rehypeStringify)
  .process(markdown);

console.log(result.tostring());
// "<p><del class="remark-del">deleted text</del></p>"

[!CAUTION]

Whitespace and newlines on either side of the wrapped text is not supported!

The following will not work:

-- unsupported whitespace before--

--unsupported whitespace after --

--
unsupported newline before--

--unsupported newline after
--

📣 Acknowledgements

This plugin is based on remark-ins

🥂 License

Released under the MIT © Drake Costa