get-md-content
get content from markdown article
Install
npm install --save get-md-content
Usage
; const isHeader = nodetype === 'Header'; // small helper function const simple = `# header content`; // simple get content without headertext); // contenttext); // contenttext); // content const basic = `# header 20 December 2012 content with two paragraphs`; // basic get content without header and datetext; // content\n\nwith two paragraphs
API
getContent(input, removeList)
input
Required
Type: String
Markdown string.
removeList
Type: Array
of Function || RegExp || String
Default: []
Matched nodes will be removed.
String
or RegExp
will be matched against plaintext markdown nodes.
Function
takes commonmark node
as a first param, and ast iteration event
as a second param. Check out commonmark-helpers shortcuts and commonmark api
Related
- 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 © Vladimir Starkov