MCPcopy Create free account
hub / github.com/chiragksharma/BuildFast / highlightText

Function highlightText

src/components/About.tsx:22–27  ·  view source on GitHub ↗
(text: string, highlights: string[])

Source from the content-addressed store, hash-verified

20 };
21
22 const highlightText = (text: string, highlights: string[]) => {
23 const parts = text.split(new RegExp(`(${highlights.join('|')})`, 'gi'));
24 return parts.map((part, index) =>
25 highlights.includes(part) ? <span key={index} className="text-primary-color underline">{part}</span> : part
26 );
27 };
28
29 const paragraphs = description.split('\n');
30

Callers 1

AboutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected