markdown-it plugin for replacing broken image link with fallback one.
Using yarn:
yarn add markdown-it-broken-image-placeholder
Or via npm:
npm install markdown-it-broken-image-placeholder
Then, to enable the feature:
import MarkdownIt from 'markdown-it';
import { brokenImagePlaceholderPlugin } from 'markdown-it-broken-image-placeholder';
const md = new MarkdownIt();
md.use(brokenImagePlaceholderPlugin({ fallbackLink: 'https://image.link' }));