File tree Expand file tree Collapse file tree
packages/docsearch-react/src/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ function App() {
99 < div >
1010 < h1 > DocSearch v3 - React</ h1 >
1111 < DocSearch
12- indexName = "docsearch "
13- appId = "R2IYF7ETH7 "
14- apiKey = "599cec31baffa4868cae4e79f180729b "
12+ indexName = "vuejs "
13+ appId = "ML0LEBN7FQ "
14+ apiKey = "21cf9df0734770a2448a9da64a700c22 "
1515 insights
1616 />
1717 </ div >
Original file line number Diff line number Diff line change @@ -12,13 +12,15 @@ export function removeHighlightTags(
1212 return hit . hierarchy . lvl0 ;
1313 }
1414
15- const { value } =
16- ( internalDocSearchHit . __docsearch_parent
17- ? internalDocSearchHit . __docsearch_parent ?. _highlightResult ?. hierarchy
18- ?. lvl0
19- : hit . _highlightResult ?. hierarchy ?. lvl0 ) || { } ;
15+ const lvl0 = internalDocSearchHit . __docsearch_parent
16+ ? internalDocSearchHit . __docsearch_parent ?. _highlightResult ?. hierarchy ?. lvl0
17+ : hit . _highlightResult ?. hierarchy ?. lvl0 ;
2018
21- return value && regexHasHighlightTags . test ( value )
22- ? value . replace ( regexHighlightTags , '' )
23- : value ;
19+ if ( ! lvl0 ) {
20+ return hit . hierarchy . lvl0 ;
21+ }
22+
23+ return lvl0 . value && regexHasHighlightTags . test ( lvl0 . value )
24+ ? lvl0 . value . replace ( regexHighlightTags , '' )
25+ : lvl0 . value ;
2426}
You can’t perform that action at this time.
0 commit comments