Extract title during markdown-it parsing.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
README.md
UNLICENSE
index.es6.js
package.json
test.js

README.md

markdown-it-title npm version

Extract title during markdown-it parsing.

Usage

const md = require('markdown-it')({ typographer: true })

// Default parameters (find `<h1>`).
md.use(require('markdown-it-title'))

// Find whatever heading comes first.
// md.use(require('markdown-it-title'), 0)

// Find `<h2>`.
// md.use(require('markdown-it-title'), 2)

const env = {}
md.render('# Hello, *`world`!(c)*', env)
env.title === 'Hello, world!©'