Display HTML code in a Drupal field as plain text
Looks like you're looking for Code Filter.


  This module provides a simple text format (input filter) that handles &lt;?php ?&gt; and &lt;code&gt;&lt;/code&gt; tags so that users can post code without having to worry about manually escaping &lt; and &gt; characters with &amp;lt; and &amp;gt;.


It is the module used on Drupal.org for escaping markup.