From 3ae2e2e2c871dc485cc0ccd8fe6a4bab3f2dc817 Mon Sep 17 00:00:00 2001 From: n1474335 Date: Tue, 9 Feb 2021 11:50:20 +0000 Subject: [PATCH] Fixed highlighting of op names where only the description has hit --- src/web/HTMLOperation.mjs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/web/HTMLOperation.mjs b/src/web/HTMLOperation.mjs index fe116eae..5fcd7b98 100755 --- a/src/web/HTMLOperation.mjs +++ b/src/web/HTMLOperation.mjs @@ -97,12 +97,13 @@ class HTMLOperation { * @param {[[number]]} descIdxs - Indexes of the search strings in the operation description [[start, length]] */ highlightSearchStrings(nameIdxs, descIdxs) { - if (nameIdxs.length) { + if (nameIdxs.length && typeof nameIdxs[0][0] === "number") { let opName = "", pos = 0; nameIdxs.forEach(idxs => { const [start, length] = idxs; + if (typeof start !== "number") return; opName += this.name.slice(pos, start) + "" + this.name.slice(start, start + length) + ""; pos = start + length;