1
0
mirror of https://github.com/BoostIo/Boostnote synced 2026-01-19 03:45:30 +00:00

Merge pull request #2510 from nagledb/nagledb-front-matter-title

Title will now be extracted from front matter if title: is present.
This commit is contained in:
Junyoung Choi (Sai)
2018-10-23 17:50:28 +09:00
committed by GitHub
6 changed files with 93 additions and 17 deletions

View File

@@ -91,7 +91,7 @@ class MarkdownNoteDetail extends React.Component {
handleUpdateContent () {
const { note } = this.state
note.content = this.refs.content.value
note.title = markdown.strip(striptags(findNoteTitle(note.content)))
note.title = markdown.strip(striptags(findNoteTitle(note.content, this.props.config.editor.enableFrontMatterTitle, this.props.config.editor.frontMatterTitleField)))
this.updateNote(note)
}

View File

@@ -112,7 +112,7 @@ class SnippetNoteDetail extends React.Component {
if (this.refs.tags) note.tags = this.refs.tags.value
note.description = this.refs.description.value
note.updatedAt = new Date()
note.title = findNoteTitle(note.description)
note.title = findNoteTitle(note.description, false)
this.setState({
note