https://github.com/leetcode-opensource/markdown-it-broken-image-placeholder
markdown-it plugin for replacing broken image link with fallback one
https://github.com/leetcode-opensource/markdown-it-broken-image-placeholder
Last synced: 9 months ago
JSON representation
markdown-it plugin for replacing broken image link with fallback one
- Host: GitHub
- URL: https://github.com/leetcode-opensource/markdown-it-broken-image-placeholder
- Owner: LeetCode-OpenSource
- License: mit
- Created: 2019-01-14T10:02:55.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-07T09:52:31.000Z (almost 3 years ago)
- Last Synced: 2025-04-16T01:19:24.281Z (9 months ago)
- Language: TypeScript
- Size: 510 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# markdown-it-broken-image-placeholder
[](https://github.com/LeetCode-OpenSource/markdown-it-broken-image-placeholder/blob/master/LICENSE)  [](https://github.com/prettier/prettier) [](https://www.npmjs.com/package/markdown-it-broken-image-placeholder)
markdown-it plugin for replacing broken image link with fallback one.
## Usage
Using [yarn](https://yarnpkg.com/):
```bash
yarn add markdown-it-broken-image-placeholder
```
Or via [npm](https://docs.npmjs.com):
```bash
npm install markdown-it-broken-image-placeholder
```
Then, to enable the feature:
```javascript
import MarkdownIt from 'markdown-it';
import { brokenImagePlaceholderPlugin } from 'markdown-it-broken-image-placeholder';
const md = new MarkdownIt();
md.use(brokenImagePlaceholderPlugin({ fallbackLink: 'https://image.link' }));
```