Fix map error
parent
5e1c1a2aa3
commit
90162cc2ce
|
@ -2,7 +2,7 @@ import { FabriqueSocialEntreprise } from '@/api/fabrique-social'
|
|||
import { Spacing } from '@/design-system/layout'
|
||||
import { Strong } from '@/design-system/typography'
|
||||
import { H4 } from '@/design-system/typography/heading'
|
||||
import { useMemo } from 'react'
|
||||
import { Fragment, useMemo } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import styled from 'styled-components'
|
||||
|
||||
|
@ -63,14 +63,14 @@ function highlightLabelToJSX(highlightLabel: string) {
|
|||
const highlightRE = /(.*?)<b><u>(.+?)<\/u><\/b>/gm
|
||||
let parsedLength = 0
|
||||
const result = []
|
||||
let matches
|
||||
let matches: RegExpExecArray | null = null
|
||||
while ((matches = highlightRE.exec(highlightLabel)) !== null) {
|
||||
parsedLength += matches[0].length
|
||||
result.push(
|
||||
<>
|
||||
<Fragment key={matches[2]}>
|
||||
{matches[1]}
|
||||
<Highlight>{matches[2]}</Highlight>
|
||||
</>
|
||||
</Fragment>
|
||||
)
|
||||
}
|
||||
result.push(highlightLabel.slice(parsedLength))
|
||||
|
|
Loading…
Reference in New Issue