|
@@ -249,6 +249,12 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+ function escapeRegExp( string ) {
|
|
|
+
|
|
|
+ return string.replace( /[.*+?^${}()|[\]\\]/g, '\\$&' ); // https://stackoverflow.com/a/6969486/5250847
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
function updateFilter( files, tags ) {
|
|
|
|
|
|
let v = filterInput.value.trim();
|
|
@@ -264,7 +270,7 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- const exp = new RegExp( v, 'gi' );
|
|
|
+ const exp = new RegExp( escapeRegExp( v ), 'gi' );
|
|
|
|
|
|
for ( const key in files ) {
|
|
|
|