(md)
| 88 | } |
| 89 | |
| 90 | export function parse(md) { |
| 91 | // Separate front-matter and body |
| 92 | const doc = fm(md); |
| 93 | const {content, blocks} = extractBlocks(doc.body); |
| 94 | |
| 95 | return Immutable.fromJS({ |
| 96 | metadata: { |
| 97 | title: doc.attributes.title, |
| 98 | created: getDate(doc.attributes), |
| 99 | author: doc.attributes.author, |
| 100 | datasources: doc.attributes.datasources || {}, |
| 101 | original: doc.attributes.original, |
| 102 | showFooter: doc.attributes.show_footer !== false |
| 103 | }, |
| 104 | content, |
| 105 | blocks |
| 106 | }); |
| 107 | } |
| 108 | |
| 109 | /* |
| 110 | * Functions for rendering blocks back into Markdown |
no test coverage detected