documentation: ask more infos and add a little important comment for me on the regex to create the title

pull/14/head
giraud florent 5 years ago
parent d7622dd23e
commit 134fca9eb0

@ -90,6 +90,8 @@ export const createMarkdownRenderer = (
)
// apply user config
// TODO: there is never options passed it alway empty object
console.log(options)
if (options.config) {
options.config(md)
}

@ -91,6 +91,8 @@ const inferTitle = (frontmatter: any, content: string) => {
if (frontmatter.title) {
return deeplyParseHeader(frontmatter.title)
}
// Here if no title or home it will take the the first # in the contect as title
const match = content.match(/^\s*#+\s+(.*)/m)
if (match) {
return deeplyParseHeader(match[1].trim())

Loading…
Cancel
Save