(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!
Default replacement patterns include:
(·
= whitespace )
... |
… |
---|---|
-- |
— |
·->· |
→ |
Agnostic to whether typographer
(markdown-it replacements) is enabled.
Your rules take precedence!
const md = require('markdown-it')({ typography: /* Boolean */ })
md.use(require('@jotdoc/replace'), { /* 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
})