From 4d2ca856d26e71c9ee074a44940b43834ac052b1 Mon Sep 17 00:00:00 2001 From: Cade Scroggins Date: Fri, 8 Jan 2021 16:22:55 +0530 Subject: [PATCH] fix capitalized suggestions --- index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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}