What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 134 Stack Exchange communities.

Possible Duplicate:
How do I format my code blocks?

Whenever I try to use HTML tags for a code example on stack overflow, the actual HTML is used on the page, instead of being escaped. To make matters more difficult, only some of the tags are not escaped, making code samples with HTML in them next to impossible. The raw textbox (where I am trying right now) is filled with ampersands and semicolons!

Is this normal, or is there just a problem with by browser or account? Am I missing something here?

EDIT: Yes, I know that you're supposed to indent code with 4 spaces. This only works for about half the tags.

share|improve this question

migrated from stackoverflow.com Jun 19 '12 at 6:09

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Shadow Wizard, Arjan, Time Traveling Bobby, Toon Krijthe, Manishearth Jun 19 '12 at 14:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Indent your code by 4 spaces. This will treat all the text as literal string. –  nhahtdh Jun 19 '12 at 5:15
    
doesn't work all the time, only works for about half of the tags. –  alecwhardy Jun 19 '12 at 5:17
4  
Can you show some example? –  nhahtdh Jun 19 '12 at 5:21
    
Stack Overflow has code blocks, read the linked faq to see how you can achieve those. –  Shadow Wizard Jun 19 '12 at 6:18

1 Answer 1

I think you may find your answer here? Apparently there is limited support for HTML tags. The post lists the tags you can use.

Post: What HTML tags are allowed on Stack Exchange sites?

<a>
<b>
<blockquote>
<code>
<del>
<dd>
<dl>
<dt>
<em>
<h1>, <h2>, <h3>
<i>
<img>
<kbd>
<li>
<ol>
<p>
<pre>
<s>
<sup>
<sub>
<strong>
<strike>
<ul>
<br/>
<hr/>

Read the post itself for more information.

share|improve this answer
2  
That post relates to what is allowed OUTSIDE code examples, I.E. mixed with markdown. The question is regarding code examples. –  Jon P Jun 19 '12 at 5:56