diff --git a/src/screens/detail/SearchScreen.js b/src/screens/detail/SearchScreen.js index ceb599f..ada726b 100644 --- a/src/screens/detail/SearchScreen.js +++ b/src/screens/detail/SearchScreen.js @@ -41,6 +41,17 @@ import AppContext from '../../components/AppContext'; const windowWidth = Dimensions.get('window').width; +const parseHighlightedText = (text) => { + const parts = text.split(/(|<\/strong>)/g); + return parts.map((part, index) => { + if (part === '') return {parts[index + 1]}; + if (part === '') return null; + if (parts[index - 1] === '') return null; + return {part}; + }); +}; + + export default function SearchScreen(props) { const navigation = useNavigation(); const context = useContext(AppContext); @@ -251,7 +262,7 @@ export default function SearchScreen(props) { navigation.goBack(); }}> - {item.org_display} + {parseHighlightedText(item.highlighted_display)} {item.category}