Skip to content
5 changes: 4 additions & 1 deletion src/plugins/search/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,10 @@ export function search(query) {
'...' +
escapeHtml(postContent)
.substring(start, end)
.replace(regEx, `<em class="search-keyword">${keyword}</em>`) +
.replace(
regEx,
word => `<em class="search-keyword">${word}</em>`
) +
'...';

resultStr += matchContent;
Expand Down