Skip to content

Code2WordPress Released

¿Are you tired of bad presented code on your WordPress Blog?
¿Have you tryed everything to scape the code?
¿Have you used every blog-writing application outhere?
And your code still shows crappy…

Now brothers, I bring you the answer to your prays.
Code2Wordpress a little webapp that process your code and give you an output that you can use directly in your wordpress blog.

The main code is this:

<br />
if(isset($_POST[&#8217;text&#8217;])){<br />
  echo &#8220;<br />
<p>&#8220;;<br />
  $text = htmlentities(stripslashes($_POST[&#8217;text&#8217;]));<br />
  $lines = explode(&#8221;\r\n&#8221;, $text);<br />
  $output=&#8221;;<br />
  foreach($lines as $line) {<br />
    $output .= htmlentities( &#8220;<code>" . str_replace(' ', '&nbsp;', $line) ."</code>\n&#8221; );<br />
  }<br />
  echo &#8220;
<p>&#8220;;<br />
}<br />

My particular WordPress Configuration is:
NOT to let WordPress try to fix my code
NOT to use Rich Text editor

I hope it works for you, ohh one thing in my Firefox under Linux the POST is received with “\r\n” line jumps, if your browser sends “\n” line jumps there will be problems, let me now your particular case to improve the app.

Post a Comment

Your email is never published nor shared. Required fields are marked *