Skip to content

lupodevelop/remark-blackout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

remark-blackout logo


npm version npm downloads MIT license


remark-blackout

A tiny remark plugin that makes it easy to obfuscate passages of text in Markdown using spoiler directives. It takes its name from the classic “blackout” style used by the KGB, the U.S. Department of Justice, or the infamous redactions in the Epstein files – where entire passages were simply painted over in black. The plugin renders the concealed content as a <spoiler> element with black-on-black styling; readers can only reveal it by selecting the text.

Installation

npm install remark-blackout remark-directive
# or
pnpm add remark-blackout remark-directive

remark-directive is a required peer dependency and must be listed before remark-blackout in your plugin array.

Usage

import remarkDirective from 'remark-directive';
import remarkBlackout from 'remark-blackout';

export default {
  // astro.config.mjs
  markdown: {
    remarkPlugins: [remarkDirective, remarkBlackout],
  },
};

Once enabled you can write in Markdown:

:::spoiler
This paragraph is censored; select it to read.
:::

Inline form: :spoiler[secret content].

The plugin simply rewrites the directive nodes into raw HTML; the styling is left to your CSS (the usual black-on-black trick is common).

Example CSS

spoiler {
  background: #000;
  color: #000;
}
spoiler::selection {
  color: #fff;
}

License

MIT

About

A tiny remark plugin that turns directives into blacked‑out elements

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors