From aae584106a6c31b038bebe3f7aab54699b7a08a3 Mon Sep 17 00:00:00 2001 From: bimlas Date: Tue, 20 Mar 2018 09:35:39 +0100 Subject: [PATCH] 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)`). --- browser/lib/search.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/lib/search.js b/browser/lib/search.js index d0cb376c..13d7c736 100644 --- a/browser/lib/search.js +++ b/browser/lib/search.js @@ -7,7 +7,7 @@ export default function searchFromNotes (notes, search) { let foundNotes = notes searchBlocks.forEach((block) => { if (block.match(/^#.+/)) { - foundNotes = findByTag(foundNotes, block) + foundNotes = findByTag(foundNotes.slice(0), block).concat(findByWord(foundNotes.slice(0), block)) } else { foundNotes = findByWord(foundNotes, block) }