mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Escape regex chars in palette filter input
This commit is contained in:
parent
feeba77f16
commit
8e6bba143a
@ -369,7 +369,7 @@ RED.palette = (function() {
|
||||
$("#palette-search-clear").show();
|
||||
}
|
||||
|
||||
var re = new RegExp(val,'i');
|
||||
var re = new RegExp(val.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'),'i');
|
||||
$("#palette-container .palette_node").each(function(i,el) {
|
||||
var currentLabel = $(el).find(".palette_label").text();
|
||||
if (val === "" || re.test(el.id) || re.test(currentLabel)) {
|
||||
|
Loading…
Reference in New Issue
Block a user