diff --git a/index.html b/index.html index 850a093..1514539 100644 --- a/index.html +++ b/index.html @@ -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, - `${this._currentInput}` - ); + const suggestionHtml = matched + ? suggestion.replace(match, `${matched[0]}`) + : suggestion; return ` ${acc}