Closed Fortyfive closed 10 years ago
I'm able to reproduce this. I'll look at some other regex options and update in the next release.
Great, look forward to it.
I've decided to remove this function for now. I'm not crazy about maintaining regexes, and I think trying to strip these tags out after the fact is the wrong approach.
I've opened a ticket, requesting a filter on wpautop()
's block elements list. If this is added, we'd be able to prevent the <img>
s from ever being wrapped with <p>
. Please voice your support for the change if you agree.
Thanks.
Will do, thanks Cooper.
Hi Cooper, your preg_replace does not seem to work:
return pregreplace( '/
\s
(<a .>)?\s(<img . \/>)\s(<\/a>)?\s_<\/p>/iU', '\1\2\3', $content );Yet this one does for me:
return pregreplace('/
\s
?(<a ._?><img.?><\/a>|<img.?>)?\s*<\/p>/s', '\1\2\3', $content);Wondered if this was a bug - are you having problems with the original? Could you also offer any advice on the validity of the syntax in my suggested replacement?
Ref: http://atg2.hostfortyfive.co.uk/about
Thanks