Extracts links from markdown texts.
$ npm install --save markdown-link-extractor
Parameters:
markdown
text in markdown format.
Returns:
- an array containing the URLs from the links found.
const { readFileSync } = require('fs');
const markdownLinkExtractor = require('markdown-link-extractor');
const markdown = readFileSync('README.md', {encoding: 'utf8'});
const links = markdownLinkExtractor(markdown);
links.forEach(link => console.log(link));
- anchor link extraction no longer supported
Code that looked like this:
const { links } = markdownLinkExtractor(str);
Should change to this:
const links = markdownLinkExtractor(str);
- extended mode no longer supported
- embedded image size parameters in
![]()
no longer supported
npm test
See LICENSE.md