prettier-plugin-markdown-replacements weekly downloads statistics
By cudoment (2 listings) · npm · Prettier plugins
Prettier plugin that applies configured text replacements to Markdown/MDX prose, leaving code spans, code blocks and MDX comments untouched.
prettier-plugin-markdown-replacements has 14 recorded weekly downloads on npm, an increase of 75.0% over the past 30 days, ranking #3061 of 3,247 tracked listings.
About prettier-plugin-markdown-replacements
prettier-plugin-markdown-replacements
English | 한국어
A Prettier plugin that applies the text replacements you register to Markdown and MDX documents, and leaves code spans, code blocks and MDX comments exactly as written.
Register the spellings you keep getting wrong, or the notation your project has settled on, and they are corrected every time a document is formatted.
Contents
- Requirements
- Installation
- Configuration
- Rule formats
- Why replacements run in the formatter
- What is protected
- Writing rules that span whitespace
- Recipes
- Using it with other plugins
- Options
- Compatibility
- Development
- License
Requirements
| Item | Version |
|---|---|
| Node.js | 18 or later |
| Prettier | 3.5.3 or later |
Installation
Install it as a dev dependency alongside Prettier.
# npm
npm install --save-dev prettier prettier-plugin-markdown-replacements
# yarn
yarn add --dev prettier prettier-plugin-markdown-replacements
# pnpm
pnpm add --save-dev prettier prettier-plugin-markdown-replacements
The package is an ES module, so name it in plugins rather than loading it with require(). Prettier 3's plugin loader handles ES modules directly, from any configuration file format.
Configuration
Add the package to plugins and list your rules. The default is empty, so nothing is replaced until you add one.
{
"plugins": ["prettier-plugin-markdown-replacements"],
"markdownReplacements": ["Javascript=>JavaScript", "Github=>GitHub"]
}
Before
<!-- prettier-ignore -->Send a Javascript request from Github.
| Field | Description |
| --- | --- |
| `Javascript` | Javascript runtime |
After
<!-- prettier-ignore -->Send a JavaScript request from GitHub.
| Field | Description |
| --- | --- |
| `Javascript` | JavaScript runtime |
Prose in the body, in headings, in lists and in table cells is corrected, while anything wrapped in code markup keeps its original spelling.
Rule formats
| Format | Example | Behavior |
|---|---|---|
| Literal | Javascript=>JavaScript | Compared as a plain string and replaced at every occurrence |
| Regular expression | /Max ([0-9]+)/g=>Maximum: $1 | Written as /pattern/flags, with capture references such as $1 available |
With the regular expression above, Max 50 becomes Maximum: 50. The g flag is added automatically when omitted, so every occurrence is replaced.
- The separator is the first
=>in a literal rule, and the=>after the flags in a regular expression rule. The replacement itself may contain=>. - Nothing is trimmed, so leading and trailing spaces are part of the rule.
- Rules are applied in array order, and the output of one rule is the input of the next.
- An entry without a separator or with an empty left side is ignored while the remaining rules still run.
- An entry that starts with
/but does not read as a regular expression rule, because the pattern is invalid or a flag is unknown, is treated as a literal rule. That keeps a path rewrite such as/docs/guide=>/docs/tutorialworking, and it also means a mistyped regular expression matches nothing rather than failing loudly. - The flags are the ones the running JavaScript engine accepts. The
vflag needs Node.js 20 or later; on Node.js 18 a rule that uses it is read as a literal rule. - In a JSON configuration file every backslash in the pattern is written twice, because JSON uses the backslash as an escape character itself. The rule
/<br\s*\/?>/gi=><br />is stored as"/<br\\s*\\/?>/gi=><br />".
Why replacements run in the formatter
Prettier decides how a document is printed and does not change what it says. A replacement changes the content, so putting one in a Prettier plugin is a deliberate choice rather than an oversight, and it is worth saying why.
Formatting is the one step that already runs on every document, in the editor on each save and in CI on each commit. A separate rewriting pass would need its own invocation, its own file discovery and its own ignore rules, and a spelling that slipped past it would sit in the repository until somebody noticed. Registering the rule here means the notation a project has settled on is applied at the moment the document is formatted, so a formatted document is a corrected one.
The rest of this page follows from that choice. A rule sees the whole source at once, which is why one that reaches across a line break rewrites the document's structure, and why the regions that have to survive verbatim are lifted out before any rule runs. When a rule turns out to be broad enough to be destructive, the plugin leaves the document exactly as it was.…
Description from the npm listing.
- prettier
- prettier-plugin
- markdown
- mdx
- replace
- typo
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm Prettier plugins plugins
All 20 prettier-plugin-markdown-replacements alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/prettier-plugin-markdown-replacements. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.