Normally when you write in Product Description and do two carriage returns when you 'inspect element' at the page preview your two returns become <br><br>
Becomes:
Where the product description is full of client entered code using the Sellerdeck 'style' buttons and you want to remove the ill advised formatting, using appearance 'Strip' or strip_tags leaves you with lots of strings of exclamation marks as the html is stripped but not the pairs of 'shrieks' that enclose each formatting. But I have not found it possible to remove the html tags and the exclamation marks and leave the <br>s.
doesn't work, <br> is removed as well.
Here is my expression, how can I adapt it to strip tags but leave <br>?
Here is the sort of thing I am up against:
Thank you!
Code:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scelerisque enim ligula venenatis dolor. Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta.
Code:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus imperdiet, nulla et dictum interdum, nisi lorem egestas vitae scelerisque enim ligula venenatis dolor. <br> <br> Maecenas nisl est, ultrices nec congue eget, auctor vitae massa. Fusce luctus vestibulum augue ut aliquet. Nunc sagittis dictum nisi, sed ullamcorper ipsum dignissim ac. In at libero sed nunc venenatis imperdiet sed ornare turpis. <br> <br> Donec vitae dui eget tellus gravida venenatis. Integer fringilla congue eros non fermentum. Sed dapibus pulvinar nibh tempor porta.
Code:
<actinic:block php="true"> strip_tags($input, '<br>'); </actinic:block>
Here is my expression, how can I adapt it to strip tags but leave <br>?
Code:
<actinic:block php="true"> $prodinput = '<actinic:variable encoding="perl" name="ProductDescription" selectable="false" />'; $prodinputx = str_replace("!!","",$prodinput); echo strip_tags($prodinputx, '<br />'); </actinic:block>
Code:
!!<<em>>!!!!<<strong>>!!!!<<span style='color: #993366;'>>!!ullamcorper ipsum dignissim!!<</span>>!!!!<</strong>>!!!!<</em>>!!
Comment