UNPKG
markdown-title
Version:
latest (1.0.2)
1.0.2
1.0.1
1.0.0
Parse title from Markdown content
github.com/phortuin/markdown-title
phortuin/markdown-title
markdown-title
/
index.js
10 lines
(8 loc)
•
200 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
const
markdownTitle
= markdown => {
let
matches = markdown.
match
(
/^#[^#][\s]*(.+?)#*?$/m
)
if
(matches && matches.
length
) {
return
matches.
pop
().
trim
() }
return
}
module
.
exports
= markdownTitle