Convert HTML

Some of my posts include snippets of code that help explain the process or describe what needs to be done. Most of the code is written in Visual Studio or Dreamweaver, and as such simply copying and pasting the code into the blog post doesn’t work.

Why? well it’s because the server thinks it’s code that needs to be compiled and rendered. Using the <pre> tag, also doesn’t always work and switching between the Visual editor and the HTML editor can cause weird results. So in order to accomplish this task really easy, I’ve created Convert HTML. Convert HTML is a simple web page that allows you to convert code tags such as < and > into their character entities (&lt; and &gt;), which is then ignored by the server for compiling, but renders correctly on the browser.

Very simple to use, just got to this page and paste in your code including the < and >, then click on Convert. Your code should now be shown, where the special characters have been replaced by the character entities. Simply copy the new code, and paste it inside your <pre> tags.

Here’s an example using Convert HTML

 <li><a href="<?php echo get_option('home'); ?>/">Home</a></li>
  <?php wp_list_pages('title_li=&depth=1'); ?>
 <li><a class="" href=""><span>Glossary</span></a></li>

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>