Commit c60aea90 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

autocomplete.js fix sample highlight

due to the differences with the matcher, the highlight regex was not
matching correctly, so the entered text was not easily apparent when
filtering sample id strings
parent f1c1d9e5
......@@ -153,7 +153,7 @@ VidjilAutoComplete.prototype = {
if (!query) {
return li;
}
regexp = new RegExp(">\\s*(\\w*?)(" + query.replace(/[\+\[\]\(\)]/g, function(s) { return "\\" + s; }) + ")(\\w*)\\s*<", 'ig');
regexp = new RegExp(">([\:\\(\\)\\[\\]A-Za-z0-9\\s\\-]*)(" + query.replace(/([\+\[\]\(\)\-])/g, function(str, s) { return "\\" + s; }) + ")([\\(\\)\\[\\]A-Za-z0-9\\s\\-]*)<", 'ig');
return li.replace(regexp, function(str, $1, $2, $3) {
return '> ' + $1 + '<strong>' + $2 + '</strong>' + $3 + ' <';
});
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment