diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/Headline.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/Headline.tsx index b247d74c3d..eb3040999b 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/Headline.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Sidebar/Search/Headline.tsx @@ -15,17 +15,21 @@ export const Headline: React.FC = ({ text, matchIndices, variant }) => { return ( <> {text.split("").map((char, index) => ( - ({ - fontWeight: isHighlighted(index) ? FONT_WEIGHT_BOLD : "regular", - fontSize: theme.typography.body2.fontSize, - })} - > - {char} - + <> + ({ + fontWeight: isHighlighted(index) ? FONT_WEIGHT_BOLD : "regular", + fontSize: theme.typography.body2.fontSize, + })} + > + {char} + + {/* Add wordbreak after special characters */} + {char.match(/\W/) && } + ))} );