get-md-links
v0.1.0
Published
Get links from markdown article
Downloads
1
Readme
get-md-links
Get links from markdown article
Install
npm install --save get-md-links
Usage
import getLinks from 'get-md-links'
const article = `# title
this is [foo](https://foo.bar)`
getLinks(article).length // 1
getLinks(article)[0].text // foo
getLinks(article)[0].href // https://foo.bar
getLinks(article)[0].html // <a href="https://foo.bar">foo</a>
getLinks(article)[0].node // AST node, see commonmark API
getLinks('') // []
API
getLinks(input[, exclude])
input
Type: string
Markdown string.
exclude(node)
Type: function
Filter function receiveing a node as argument.
Related
- article-data - extract data from your markdown article
- get-md-content - get content from markdown article
- get-md-date - get date from markdown article
- get-md-desc - get description from markdown article
- get-md-image - get image from markdown article
- get-md-title - get title from markdown article
License
MIT