mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 09:46:22 +00:00
Look for tags in context too
The previous commit broke this behaviour. Looking for a tag means the union of **tags** AND **tag in content**, so it has to search in the in currently found notes separetely, thus it has to clone the list first (`.slice(0)`).
This commit is contained in:
@@ -7,7 +7,7 @@ export default function searchFromNotes (notes, search) {
|
|||||||
let foundNotes = notes
|
let foundNotes = notes
|
||||||
searchBlocks.forEach((block) => {
|
searchBlocks.forEach((block) => {
|
||||||
if (block.match(/^#.+/)) {
|
if (block.match(/^#.+/)) {
|
||||||
foundNotes = findByTag(foundNotes, block)
|
foundNotes = findByTag(foundNotes.slice(0), block).concat(findByWord(foundNotes.slice(0), block))
|
||||||
} else {
|
} else {
|
||||||
foundNotes = findByWord(foundNotes, block)
|
foundNotes = findByWord(foundNotes, block)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user