0.1.0 • Published 3 years ago

util-md-to-arrays v0.1.0

Weekly downloads
-
License
AGPL-3.0-or-later
Repository
-
Last release
3 years ago

util-md-to-arrays

Given a markdown segment like:

A paragraph

- Item 1
  - Item 1.1
  - Item 1.2
- Item 2

This utility will return an array like:

[
  'A paragraph',
  [
    '- Item 1\n  - Item 1.1\n  - Item 1.2',
    '- Item 2',
  ]
]

Or put differently, the markdown input will be split into an array of segments, and any lists will be further split into an array of items. Note that nested lists are included as part of the parent list.

Also note that frontmatter is not supported and any input string which begins with ---\n will throw.

0.1.0

3 years ago