eruna — 2012-05-24T16:03:02-04:00 — #1
The WYSIWYG editor in the CMS I'm using encloses tables in paragraphs. <p><table>
This is causing a problem when it interfaces with another tool.
I'm trying to remove the unwanted paragraph tags on the back side. It would need to be able to handle <p><table>, <p>[whitespace]<table>, <p> <table class='data'>, etc..
This is what I've come up with so far.
Any help would be appreciated
wonshikee — 2012-05-24T22:11:04-04:00 — #2
Honestly though, it sounds like putting band-aids on a gunshot wound and you'll have other issues as well with that editor, should use something better.
scallioxtx — 2012-05-26T19:19:01-04:00 — #3
$str = preg_replace('~<p>\\s*(<table(.*?)</table>)\\s*</p>~i', "$1", $str);