From 7e59ffa53dfbd6ebafd6a6b854ce7d2293fe71b8 Mon Sep 17 00:00:00 2001 From: Tony Arcangelini <33258733+arcangelini@users.noreply.github.com> Date: Wed, 15 Jan 2025 08:23:00 +0100 Subject: [PATCH] Reader: fix highlighted text formatting (#98149) --- client/lib/post-normalizer/rule-content-remove-styles.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/lib/post-normalizer/rule-content-remove-styles.js b/client/lib/post-normalizer/rule-content-remove-styles.js index d70df275e446b..ca7d8c8464937 100644 --- a/client/lib/post-normalizer/rule-content-remove-styles.js +++ b/client/lib/post-normalizer/rule-content-remove-styles.js @@ -16,10 +16,15 @@ export default function removeContentStyles( post, dom ) { throw new Error( 'this transform must be used as part of withContentDOM' ); } - // Allow the markup for galleries, Instagram, and Twitter. Styling will be allowed on elements that match this selector. + // Styling will be allowed on elements that match this selector. const allowedMarkupSelector = + // Inline highlighted text + 'mark.has-inline-color, ' + + // Gallery '.gallery, .gallery *, .gallery-row, .gallery-row *, .gallery-group, .gallery-group *, ' + + // Instagram 'blockquote[class^="instagram-"], blockquote[class^="instagram-"] *, ' + + // Twitter 'blockquote[class^="twitter-"], blockquote[class^="twitter-"] *'; // remove most style attributes