If $content is the smarty variable which holds the HTML content, then use the below regex to parse it and strip <img> tag:
{$content | regex_replace:"/(<img>|<img [^>]*>|<\\/>)/":""}
We can use this to strip any html tags. If you wanna strip <p> tag:
{$content | regex_replace:"/(<p>|<p[^>]*>|<\\/p>)/":""}
This will replace
<p>, </p> and all <p many attributes> strings with an empty string. Thats It!!
No comments:
Post a Comment