Commit 69241cb2 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

autocomplete.js fix highlight strong characters

with changes to the highlighter, the strong characters indicating the
matching substring was broken.
parent fa4abd84
......@@ -168,7 +168,7 @@ VidjilAutoComplete.prototype = {
if (!query) {
return li;
}
regexp = new RegExp(">([\\:\\(\\)\\[\\]A-Za-z0-9\\-]+\\s*)+(" + query.replace(/([\+\[\]\(\)\-])/g, function(str, s) { return "\\" + s; }) + ")([\\(\\)\\[\\]A-Za-z0-9\\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