fix capitalized suggestions

This commit is contained in:
Cade Scroggins 2021-01-08 16:22:55 +05:30
parent 75371b79f9
commit 4d2ca856d2
No known key found for this signature in database
GPG key ID: 6AC5A902158265D0

View file

@ -1001,11 +1001,11 @@
.slice(0, this._limit)
.reduce((acc, suggestion) => {
const match = new RegExp($.escapeRegex(this._currentInput), 'ig');
const matched = suggestion.match(match);
const suggestionHtml = suggestion.replace(
match,
`<b>${this._currentInput}</b>`
);
const suggestionHtml = matched
? suggestion.replace(match, `<b>${matched[0]}</b>`)
: suggestion;
return `
${acc}