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

Add code snippets to search scope

This commit is contained in:
Steve Klein
2018-07-20 02:00:11 -07:00
parent 6cad2ab4df
commit 1e5a7356f4

View File

@@ -23,7 +23,9 @@ function findByWordOrTag (notes, block) {
return true
}
if (note.type === 'SNIPPET_NOTE') {
return note.description.match(wordRegExp)
return note.description.match(wordRegExp) || note.snippets.some((snippet) => {
return snippet.name.match(wordRegExp) || snippet.content.match(wordRegExp)
})
} else if (note.type === 'MARKDOWN_NOTE') {
return note.content.match(wordRegExp)
}