outeredge / magento-structured-data-module

Magento Structured Data Module by outer/edge
MIT License
47 stars 13 forks source link

Remove Page Builder Tags #23

Closed vseager closed 2 years ago

vseager commented 2 years ago

https://github.com/outeredge/magento-structured-data-module/blob/master/view/frontend/templates/jsonld/cms.phtml#L3

Example:

            ,"name": "TEST WEBSITE",
"mainContentOfPage": {
    "text": "#html-body [data-pb-style=LT6FTLU],#html-body [data-pb-style=WSTN6LW]{justify-content:flex-start;display:flex;flex-direction:column;background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}#html-body [data-pb-style=LT6FTLU]{background-color:#343434;background-position:center center;text-align:center;width:calc(100% - 10px);margin:5px;align-self:stretch}#html-body [data-pb-style=BCMK9PP]{text-align:center;display:none;margin:50px}#html-body [data-pb-style=QEYDKVU]{display:inline-block}#html-body [data-pb-style=ED5YSAE]{text-align:center;margin-top:200px;margin-bottom:24px}#html-body [data-pb-style=MO8CUCM]{display:none}#html-body [data-pb-style=BIWHEVO]{justify-content:flex-start;display:flex;flex-direction:column;background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}#html-body [data-pb-style=VGI6B5G]{border-style:none}#html-body [data-pb-style=DG7GN1E],#html-body [data-pb-style=QCJPGNL]{max-width:100%;height:auto}#html-body [data-pb-style=JD5GKXP]{display:none}#html-body [data-pb-style=CB4UQX4]{justify-content:flex-start;display:flex;flex-direction:column;background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}#html-body [data-pb-style=ODY9PWL]{justify-content:flex-start;display:flex;flex-direction:column;width:25%;align-self:stretch}#html-body [data-pb-style=H8NWJPE],#html-body [data-pb-style=ODY9PWL]{background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}#html-body [data-pb-style=U4V4YIE]{opacity:1;visibility:visible}#html-body [data-pb-style=JSBUIFW]{justify-content:flex-start;display:flex;flex-direction:column;width:25%;align-self:stretch}#html-body [data-pb-style=H3WLG3J],#html-body [data-pb-style=JSBUIFW]{background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}#html-body [data-pb-style=B19K8E0]{opacity:1;visibility:visible}#html-body [data-pb-style=XRMV4LN]{justify-content:flex-start;display:flex;flex-direction:column;width:25%;align-self:stretch}#html-body [data-pb-style=WKU1TDR],#html-body [data-pb-style=XRMV4LN]{background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}#html-body [data-pb-style=IAKEFVF]{opacity:1;visibility:visible}#html-body [data-pb-style=M2JPQSS]{justify-content:flex-start;display:flex;flex-direction:column;width:25%;align-self:stretch}#html-body [data-pb-style=LKL3H4I],#html-body [data-pb-style=M2JPQSS]{background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}#html-body [data-pb-style=BDL9UT4]{opacity:1;visibility:visible}#html-body [data-pb-style=PJ3F34P]{justify-content:flex-start;display:flex;flex-direction:column;background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}#html-body [data-pb-style=MB7J7GC]{justify-content:flex-start;display:flex;flex-direction:column;width:25%;align-self:stretch}#html-body [data-pb-style=MB7J7GC],#html-body [data-pb-style=QALLSGI]{background-position:left top;background-size:cover;background-repeat:no-repeat;background-attachment:scroll}#html-body [data-pb-style=X5X1BSG]{opacity:1;visibility:visible}#html-body [data-pb-style=GLRFWVM]{justify-content:flex-start;display:flex;flex-direction:column;width:25%;align-self:stretch}#html-body [data-pb-style=GLRFWVM],#html-body [data-pb-style=WO4DG5V
davidwindell commented 2 years ago

@vseager something like this

strip_tags(preg_replace('~<style(.*?)</style>~Usi', "", $var));
vseager commented 2 years ago

@davidwindell Perfect, I was thinking we could add this into an abstract block so that it's applied to all page types and fields where stripeTags() is used?