Skip to content

Commit

Permalink
New: Smart quote support for mobile browsers on search input
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanJard committed Jun 19, 2023
1 parent c2bf0c0 commit 1a3ad0c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion js/core/core.filter.js
Expand Up @@ -298,11 +298,15 @@ function _fnFilterCreateSearch( search, regex, smart, caseInsensitive )
*
* ^(?=.*?\bone\b)(?=.*?\btwo three\b)(?=.*?\bfour\b).*$
*/
var a = $.map( search.match( /"[^"]+"|[^ ]+/g ) || [''], function ( word ) {
var a = $.map( search.match( /["\u201C][^"\u201D]+["\u201D]|[^ ]+/g ) || [''], function ( word ) {
if ( word.charAt(0) === '"' ) {
var m = word.match( /^"(.*)"$/ );
word = m ? m[1] : word;
}
else if ( word.charAt(0) === '\u201C' ) {
var m = word.match( /^\u201C(.*)\u201D$/ );
word = m ? m[1] : word;
}

return word.replace('"', '');
} );
Expand Down

0 comments on commit 1a3ad0c

Please sign in to comment.