Skip to content

Commit 181c1e5

Browse files
committed
fix($markdown): sidebar headers not being detected (close: #841)
header will not be detected when some content are placed before h1
1 parent 747d642 commit 181c1e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/util/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ exports.inferTitle = function (frontmatter) {
3434
if (frontmatter.data.title) {
3535
return deeplyParseHeaders(frontmatter.data.title)
3636
}
37-
const match = frontmatter.content.trim().match(/^#+\s+(.*)/)
37+
const match = frontmatter.content.trim().match(/^#+\s+(.*)/m)
3838
if (match) {
3939
return deeplyParseHeaders(match[1])
4040
}

0 commit comments

Comments
 (0)