This is a simple parser for Markdown list.
npm install md-list-parser
import * as LP from 'md-list-parser';
const input = `
- a
- b
- d
- e
- f
`;
const result = LP.parse(input);
to get
const result = [
{
title: 'a',
children: [
{
title: 'b',
},
{
title: 'd',
children: [
{
title: 'e',
},
],
},
],
},
{
title: 'f',
},
]