Make WP not format code, not insert line breaks in between tags

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>

becomes

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

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){
$str=preg_replace("/(\t|\r|\n)/","",$str);  
return $str;
}

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

Related posts