diff --git a/components/x-gift-article/src/GiftArticle.jsx b/components/x-gift-article/src/GiftArticle.jsx index cba9d9624..d4925b715 100644 --- a/components/x-gift-article/src/GiftArticle.jsx +++ b/components/x-gift-article/src/GiftArticle.jsx @@ -262,7 +262,8 @@ const withGiftFormActions = withActions( getHighlightPreview() { return (state) => { state.highlight = document.querySelector(`.${state.highlightClassName}`)?.textContent - return { highlight: state.highlight } + state.highlightClassName = document.querySelector(`.${state.highlightClassName}`)?.classList.value + return { highlight: state.highlight, highlightClassName: state.highlightClassName } } } } diff --git a/components/x-gift-article/src/IncludeHighlights.jsx b/components/x-gift-article/src/IncludeHighlights.jsx index 6c5ed7e39..ab7f0171d 100644 --- a/components/x-gift-article/src/IncludeHighlights.jsx +++ b/components/x-gift-article/src/IncludeHighlights.jsx @@ -2,7 +2,7 @@ import { h } from '@financial-times/x-engine' import { canShareWithNonSubscribers, isNonSubscriberOption, trimHighlights } from './lib/highlightsHelpers' export const IncludeHighlights = (props) => { - const { actions, highlight, enterpriseEnabled, includeHighlights } = props + const { actions, highlight, enterpriseEnabled, includeHighlights, highlightClassName } = props const _canShareWithNonSubscribers = canShareWithNonSubscribers(props) const _isNonSubscriberOption = isNonSubscriberOption(props) @@ -18,7 +18,17 @@ export const IncludeHighlights = (props) => { role="group" > {includeHighlights && ( -

{trimHighlights(highlight)}

+
+

+ + Highlighted text when shared: + +

+ + + {trimHighlights(highlight)} + +
)}