]> _ Git - fluidbook-html5.git/commitdiff
wait #6188 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 19 Sep 2023 14:35:37 +0000 (16:35 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 19 Sep 2023 14:35:37 +0000 (16:35 +0200)
js/libs/fluidbook/fluidbook.search.js

index 68fa1d7afff658288d09335944558c0cf050333b..2b04946ad75980ce5053fde63c7bd1f485cf9c8b 100644 (file)
@@ -586,6 +586,9 @@ FluidbookSearch.prototype = {
                         }
                     }
                 }
+                if (filteredOccurences.length === 0) {
+                    return;
+                }
                 occurences = filteredOccurences;
             }
         }
@@ -597,7 +600,7 @@ FluidbookSearch.prototype = {
         for (let i in occurences) {
             let o = occurences[i];
             this.highlights.push({occurences: [o], color: 0, word: term, term: term});
-            if(o.next) {
+            if (o.next) {
                 this.highlights.push({occurences: o.next, color: 0, word: term, term: term});
             }
         }