mirror of
https://gitlab.com/MrFry/qmining-page
synced 2025-04-01 20:23:44 +02:00
All questions query fix, question search highlight fix
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import React from 'react'
|
||||
|
||||
function highlightText(text, toHighlight) {
|
||||
if (!text) {
|
||||
return ''
|
||||
}
|
||||
const re = new RegExp(toHighlight, 'gi')
|
||||
return text.replace(re, `<mark>${toHighlight}</mark>`)
|
||||
}
|
||||
|
Reference in New Issue
Block a user