remark-inline-spoiler
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

remark-inline-spoiler

Thanks to benrbray/remark-cite for a remark plugin boilerplate.

license

Plugin for remark to support Discord-style spoilers. Relies on micromark-extension-inline-spoiler for tokenization and mdast-util-inline-spoiler for converting markdown to/from abstract syntax trees.

Install

Install remark-inline-spoiler on npm, yarn or bun.

npm install remark-inline-spoiler
yarn add remark-inline-spoiler
bun install remark-inline-spoiler

Usage

const unified = require('unified')
const markdown = require('remark-parse')
const { spoilerPlugin } = require('remark-inline-spoiler');

let processor = unified()
    .use(markdown)
    .use(spoilerPlugin, {})

Running the processor on the following markdown:

||Don't spoil this||

Will produce the following spoiler node:

{
	"type": "spoiler",
	"value": "Don't spoil this"
}

Package Sidebar

Install

npm i remark-inline-spoiler

Weekly Downloads

1

Version

1.0.1

License

MIT

Unpacked Size

16.7 kB

Total Files

14

Last publish

Collaborators

  • hlysine