Skip to content
This repository was archived by the owner on Apr 15, 2018. It is now read-only.

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

Parse two levels of headers from markdown file.

It transforms this markdown:

# Main header
First paragraph
## Subheader
Subheader text
# Second header

into

{
sections: [
{
name: 'Main header',
text: ['para', 'First paragraph'], // markdown-js JsonMl
subsections: [
{
name: 'Subheader',
text: ['para', 'Subheader text']
}
]
},
{
name: 'Second header'
}
]
}

Content before first header is put into "preamble" section, with name set to null.

Run tests

To try it out run the tests:

> npm test

If you want to add more testcases to see what conditions I failed to consider, just add it to test/sections.coffee

About

Parse two levels of headers from markdown file

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages