JSPM

micromark-extension-inline-spoiler

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 6
  • Score
    100M100P100Q48561F
  • License MIT

Micromark syntax extension for Discord-style spoilers.

Package Exports

  • micromark-extension-inline-spoiler
  • micromark-extension-inline-spoiler/dist/index.cjs.js
  • micromark-extension-inline-spoiler/dist/index.esm.js
  • micromark-extension-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 (micromark-extension-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

micromark-extension-inline-spoiler

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

license

A micromark syntax extension for Discord-style spoilers, providing the low-level modules for integrating with the micromark tokenizer and the micromark HTML compiler.

You probably shouldn’t use this package directly, but instead use mdast-util-inline-spoiler with mdast or remark-inline-spoiler with remark.

Install

Install micromark-extension-inline-spoiler on npm, yarn or bun.

npm install micromark-extension-inline-spoiler
yarn add micromark-extension-inline-spoiler
bun install micromark-extension-inline-spoiler

Usage

import micromark from "micromark";
import { spoilerSyntax, spoilerHtml } from "micromark-extension-inline-spoiler";

let serialized = micromark('||Don\'t spoil this||', {
    extensions: [spoilerSyntax()],
    htmlExtensions: [spoilerHtml()]
});

The serialized result will be the following. To get an abstract syntax tree, use mdast-util-inline-spoiler instead.

<p><span class="spoiler">Don't spoil this</span></p>