Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.32 KB

README.md

File metadata and controls

47 lines (35 loc) · 1.32 KB

@jotdoc/replace npm

(User-defined) inline pattern substitutions for the markdown-it parser

❗⠀This plugin belongs to a family of experimental features called Jotdoc: a "flavor" of Markdown aiming to maximize readability and extend markup for common use cases where verbose HTML is required.

If you're interested, please do share your thoughts and check out the monorepo!

Demo

Default replacement patterns include:

(· = whitespace )

...
--
·->·

Agnostic to whether typographer (markdown-it replacements) is enabled. Your rules take precedence!

Enable

const md = require('markdown-it')({ typography: /* Boolean */ })

      md.use(require('@jotdoc/replace'), { /* OPTIONS */ })

Options

Disable rules by name:

...
const replace = require('@jotdoc/replace')
md.use(replace), {larrow: false})

—or add your own like so:

replace.res.push({
  name: 'neq',
  re: /!=/g,
  sub: "\u2260", // ≠
  default: true
})