JSPM

remark-inline-spoiler

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q45465F
  • License MIT

A `remark` plugin for Discord-style spoilers.

Package Exports

  • remark-inline-spoiler
  • remark-inline-spoiler/dist/index.cjs.js
  • remark-inline-spoiler/dist/index.esm.js
  • remark-inline-spoiler/dist/index.umd.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (remark-inline-spoiler) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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"
}