1.0.3 • Published 5 years ago

remark-redact v1.0.3

Weekly downloads
7
License
MIT
Repository
github
Last release
5 years ago

remark-redact

This plugin parses markdown to obscure passages between two tokens.

Syntax

You can redact passages of your text like this:

  Please don't show my /~ Secret Stuff ~/

Any alphanumeric characters between the /~ and ~/ will will be replaced with a . Like so:

  Please don't show my  ██████ █████

WARNING

This plugin obscures text from being read after it is processed. If your source markdown files reside on a public repo, they will, obviously, not be protected by this plugin.

Configuration

There are currently three options available, which are passed in via a single configuration object.

{beginMarker = '/~', endMarker = '~/', replacer: '█'}

Therefore, invoking this plugin this way:

  .use(redact, {
    beginMarker: '<',
    endMarker: '>',
    replacer: 'X'
  })

will make this plugin remove what's put between < and > and replace those characters with X.

Usage

Dependencies:

const unified = require("unified");
const remarkParse = require("remark-parse");
const stringify = require("rehype-stringify");
const remark2rehype = require("remark-rehype");

const remarkRedact = require("remark-redact");

Usage:

unified()
  .use(remarkParse)
  .use(remarkRedact)
  .use(remark2rehype)
  .use(stringify);

License

MIT © Steve Barman

Redact is very very heavily indebted to remark-comments

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago