browser: fix regexp for case insensitive search
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 29 Sep 2020 16:04:27 +0000 (18:04 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 20 Oct 2020 20:49:11 +0000 (22:49 +0200)
Ignored when applied to match function, even following a RegExp.

searchlocal.js

index 512f07b8482cf1bf293e16c09d385a6178fb014a..6498e32e06c196aa0a6669ed1ae573c33933058f 100644 (file)
@@ -106,7 +106,7 @@ if (document.querySelector !== undefined) {
        else {
                // title text (case-insensitive unless caps in input)
                var match = function(row) {
-                       return row.cells[1].textContent.match(query, /[A-Z]/.test(query) ? '' : 'i');
+                       return row.cells[1].textContent.match(new RegExp(query, /[A-Z]/.test(query) ? '' : 'i'));
                };
        }
        filterrows(table, match, action || 'filter');