1

I am using PHP native strip_tags to remove all HTML from content that is coming from Magento's page builder. It does strip some but not all markup. See below.

Is there a Magento native solution for this? Or maybe a custom strip tags implementation?

This.

<style>#html-body [data-pb-style=BJCY4X9]{justify-content:flex-start;display:flex;flex-direction:column;background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}</style><div data-content-type="row" data-appearance="contained" data-element="main"><div data-enable-parallax="0" data-parallax-speed="0.5" data-background-images="{}" data-background-type="image" data-video-loop="true" data-video-play-only-visible="true" data-video-lazy-load="true" data-video-fallback-src="" data-element="inner" data-pb-style="BJCY4X9"><div data-content-type="text" data-appearance="default" data-element="main"><p>lorem ipsum</p></div></div></div>

Is stripped down to this:

#html-body [data-pb-style=BJCY4X9]{justify-content:flex-start;display:flex;flex-direction:column;background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}lorem ipsum

What I want it to return, is this:

lorem ipsum

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.