util-md-to-arrays
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i util-md-to-arrays

Weekly Downloads

1

Version

0.1.0

License

AGPL-3.0-or-later

Unpacked Size

49 kB

Total Files

17

Last publish

Collaborators

  • chmac