On occasion a <figure>
tag will make it through WYGWAM with a <p>
wrapped around it which breaks my layout (and is incorrect formatting anyway). Can I remove just the <p>
tags that appear around specific elements? If so, how?
1 Answer
You can use the add-on Find and Replace Plus. http://devot-ee.com/add-ons/find-and-replace-plus
This should work for you.
{exp:replace_plus}
{replace_area find="<p><figure>" replace="<figure>"}
{replace_area find="</figure></p>" replace="</figure>"}
text you want processed
{/replace_area}
{/replace_area}
{/exp:replace_plus}
-
So this should work but it's not recognizing the white space between
<p>
and<figure>
tags. In the HTML there is often whitespace and newlines between those tags. Tried this but it didn't work:{replace_area find="<p>:SPACE:<figure" replace="<figure"}
Jul 26, 2013 at 15:50