markdown-title

1.0.2 • Public • Published

markdown-title Build Status

Parses title from Markdown-formatted text

Install

$ npm install markdown-title

Usage

const markdownTitle = require('markdown-title')
 
let markdown = `
# Title
`
 
let title = markdownTitle(markdown) //=> Title

The first H1-level title that is found in your Markdown document will be returned, regardless of its position. Supports pound-style headers, not underlined headers (see original Markdown docs). The reason is that I haven’t ever found an underlined header in the wild, and it’s much harder to parse:

This works:

# Title

This, too:

#     I can title? #

This doesn’t:

Title
=====

License

MIT © Anne Fortuin

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.268latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.268
1.0.10
1.0.00

Package Sidebar

Install

npm i markdown-title

Weekly Downloads

68

Version

1.0.2

License

MIT

Unpacked Size

4.25 kB

Total Files

7

Last publish

Collaborators

  • phortuin