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:
parent
4bcbaa4cc1
commit
867568d446
2 changed files with 45 additions and 24 deletions
|
@ -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>`)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue