A markdown-it plugin that allows you to replace markdown content with custom content.
npm i md-replacer-plugin
yarn add md-replacer-plugin
As a Node module:
import MarkdownIt from "markdown-it"
import replaceVarPlugin from "md-replacer-plugin"
const text = MarkdownIt().use(replaceVarPlugin, { variable: "testing" }).render("variable")
From the markdown-it development recommendations:
Plugins should not require the
markdown-it
package as a dependency inpackage.json
.
Note, for typing, we import this package with import type
, to ensure the imports are not present in the compiled JavaScript.
There are a number of JavaScript unit testing frameworks (see this comparison, but [jest] was chosen because of it is easy to setup/use, flexible, and well used in large projects.
The three main bundlers are; Webpack, Rollup and Parcel, with the functionality gap between all of these bundlers narrowing over the years.
Essentially, Rollup provides a middle ground between features and complexity, and is good for bundling libraries (it is what markdown-it
itself uses).
See, for example: