Gahhhh! Are you kidding? Ok, I guess wp wants my source code all nice and formatted...

<a href="/asdf">i'm a link</a><ul><li>list item</li></ul>


<p><a href="/asdf">i'm a link</a>
<li>list item</li>

Ok, so it puts a unclosed p tag, that sucks, but who cares. Also, I wouldnt care about the formatting, but when you put a (script) tag in there, it bumps it down 2 lines, so then it gets wrapped in a (p) tag of its own.

<p><script type="text/javascript">jQuery(document).ready(function(){  jQuery('.flexslider').flexslider({animation: "slide"  });});</script>

actually, yeah, again with the unclosed p tag...

This stuff is coming from a shortcode function, on which i'm running

function stripNewLinesPreg($str){
return $str;

So... I've tried the no_texturize_shortcodes filter. Seems to do nothing.

  • I'm not sure if this will help, but could you run it through wpautop and set breaks to false etc.? – Howdy_McGee Sep 6 '13 at 19:25
  • Same result, breaks true or false... I guess that means it's not wpautop... – Doug Cassidy Sep 6 '13 at 19:45
  • Maybe try this code – Howdy_McGee Sep 6 '13 at 19:53
  • Yeah, but then you wind up breaking plugins, etc that rely on wpautop and wptexturize. – Doug Cassidy Sep 6 '13 at 21:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.