Skip to content

Commit 71775f1

Browse files
committed
Create README.md
1 parent 023ba0b commit 71775f1

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

README.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# markdown-it-broken-image-placeholder
2+
[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/LeetCode-OpenSource/markdown-it-broken-image-placeholder/blob/master/LICENSE) ![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat)](https://github.com/prettier/prettier) [![npm version](https://img.shields.io/npm/v/markdown-it-broken-image-placeholder.svg?style=flat)](https://www.npmjs.com/package/markdown-it-broken-image-placeholder)
3+
4+
markdown-it plugin for replacing broken image link with fallback one.
5+
6+
## Usage
7+
8+
Using [yarn](https://yarnpkg.com/):
9+
```bash
10+
yarn add markdown-it-broken-image-placeholder
11+
```
12+
13+
Or via [npm](https://docs.npmjs.com):
14+
```bash
15+
npm install markdown-it-broken-image-placeholder
16+
```
17+
18+
Then, to enable the feature:
19+
20+
```javascript
21+
import MarkdownIt from 'markdown-it';
22+
import { brokenImagePlaceholderPlugin } from 'markdown-it-broken-image-placeholder';
23+
24+
const md = new MarkdownIt();
25+
26+
md.use(brokenImagePlaceholderPlugin({ fallbackLink: 'https://image.link' }));
27+
```

0 commit comments

Comments
 (0)