Skip to content

Commit

Permalink
fix($markdown): sidebar headers not being detected (close: #841)
Browse files Browse the repository at this point in the history
header will not be detected when some content are placed before h1
  • Loading branch information
ulivz committed Sep 15, 2018
1 parent 747d642 commit 181c1e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exports.inferTitle = function (frontmatter) {
if (frontmatter.data.title) {
return deeplyParseHeaders(frontmatter.data.title)
}
const match = frontmatter.content.trim().match(/^#+\s+(.*)/)
const match = frontmatter.content.trim().match(/^#+\s+(.*)/m)
if (match) {
return deeplyParseHeaders(match[1])
}
Expand Down

0 comments on commit 181c1e5

Please sign in to comment.