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

1.0.0 • Public • Published

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>

Package Sidebar

Install

npm i micromark-extension-inline-spoiler

Weekly Downloads

13

Version

1.0.0

License

MIT

Unpacked Size

50.1 kB

Total Files

14

Last publish

Collaborators

  • hlysine