1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

Title will now be extracted from front matter if title: is present.

This commit is contained in:
David Nagle
2018-10-19 10:59:37 -07:00
parent ff3026686f
commit 0e38f61c85
2 changed files with 22 additions and 13 deletions

View File

@@ -15,7 +15,10 @@ test('findNoteTitle#find should return a correct title (string)', t => {
['====', '===='],
['```\n# hoge\n```', '```'],
['hoge', 'hoge'],
['---\nlayout: test\n---\n # hoge', '# hoge']
['---\nlayout: test\n---\n # hoge', '# hoge'],
['---\nlayout: test\ntitle: hoge hoge hoge \n---\n# fuga', 'hoge hoge hoge'],
['---\ntitle:hoge\n---\n# fuga', 'hoge'],
['title: fuga\n# hoge', '# hoge']
]
testCases.forEach(testCase => {
@@ -23,4 +26,3 @@ test('findNoteTitle#find should return a correct title (string)', t => {
t.is(findNoteTitle(input), expected, `Test for find() input: ${input} expected: ${expected}`)
})
})