diff --git a/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.tsx b/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.tsx index b9bc53b4274..a9d21bbb472 100644 --- a/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.tsx +++ b/openmetadata-ui/src/main/resources/ui/src/components/searched-data/SearchedData.tsx @@ -62,22 +62,15 @@ const SearchedData: React.FC = ({ const highlightSearchResult = () => { return data.map((table, index) => { let tDesc = table.description; - const highLightedTexts = !isEmpty(table.highlight?.description) - ? table.highlight?.description.join(' ') || '' - : ''; - const highlightTxtMatch = highLightedTexts.match( - /(.*?)<\/span>/g - ); - if (highlightTxtMatch) { - const matchTextArr = highlightTxtMatch.map((val) => + const highLightedTexts = table.highlight?.description || []; + + if (highLightedTexts) { + const matchTextArr = highLightedTexts.map((val) => val.replace(/<\/?span(.*?)>/g, '') ); - matchTextArr.forEach((text) => { - const regEx = new RegExp(`\\b${text}\\b`, 'g'); - tDesc = tDesc.replace( - regEx, - `${text}` - ); + + matchTextArr.forEach((text, i) => { + tDesc = tDesc.replace(text, highLightedTexts[i]); }); } diff --git a/openmetadata-ui/src/main/resources/ui/src/styles/x-master.css b/openmetadata-ui/src/main/resources/ui/src/styles/x-master.css index 7fefcb26299..64f399facc7 100644 --- a/openmetadata-ui/src/main/resources/ui/src/styles/x-master.css +++ b/openmetadata-ui/src/main/resources/ui/src/styles/x-master.css @@ -706,7 +706,7 @@ a:focus { .text-highlighter { background-color: #ffc34e40; - padding: 0.25rem; + padding: 0 0.25rem; } body .profiler-graph .recharts-active-dot circle {