From ecc660ed68f44b24b42a7c379fff55bf44b7d248 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Wed, 17 Apr 2024 19:02:02 +0530 Subject: [PATCH] fix: inline filter with html chars (#198) Filtering with `&` doesn't work because it gets escaped in HTML. --- src/filterRows.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/filterRows.js b/src/filterRows.js index 78f6d26..11b0aa3 100644 --- a/src/filterRows.js +++ b/src/filterRows.js @@ -68,9 +68,10 @@ function getFilterMethod(rows, allData, filter) { contains(keyword, cells) { return cells .filter(cell => { - const hay = stringCompareValue(cell); const needle = (keyword || '').toLowerCase(); - return !needle || hay.includes(needle); + return !needle || + (cell.content || '').toLowerCase().includes(needle) || + stringCompareValue(cell).includes(needle); }) .map(cell => cell.rowIndex); },