From 47ab1b67e37de1c31f1ed3c75d194fd7e4dbecd8 Mon Sep 17 00:00:00 2001 From: Colin Marks Date: Thu, 23 May 2019 11:24:25 +0100 Subject: [PATCH] DEV allows searching for ampersands in searchpane text --- features/searchPane/dataTables.searchPane.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/features/searchPane/dataTables.searchPane.js b/features/searchPane/dataTables.searchPane.js index 1ad217f..723c3f3 100644 --- a/features/searchPane/dataTables.searchPane.js +++ b/features/searchPane/dataTables.searchPane.js @@ -221,7 +221,7 @@ } }, - _getOptions: function ( colIdx ) { + _getOptions: function(colIdx) { var table = this.s.dt; return table.settings()[0].aoColumns[colIdx].searchPane || {}; @@ -257,7 +257,10 @@ var d = $(filter) .data('filter') .toString(); - return $.fn.dataTable.util.escapeRegex(d); + var decoded = $('
') + .html(d) + .text(); + return $.fn.dataTable.util.escapeRegex(decoded); }).join('|') + ')', true, @@ -275,7 +278,10 @@ var d = $(filter) .data('filter') .toString(); - return $.fn.dataTable.util.escapeRegex(d); + var decoded = $('
') + .html(d) + .text(); + return $.fn.dataTable.util.escapeRegex(decoded); }).join('|') + ')$', true,