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

While editing this response, I noticed that some of the poster's code had not rendered. Specifically, the <source> tag and its closure did not render when the code was left-justified. Once I made a code block out of it, the elements rendered.

Before:

class MyComparer : IComparer<int>
{

  public int Compare(int x, int y)
  {
    if (x < y)
      return -1;
    else return 1;
  }
}

After:

<source lang='C#'>

    class MyComparer : IComparer<int>
    {

      public int Compare(int x, int y)
      {
        if (x < y)
          return -1;
        else return 1;
      }
    }
</source>

If you edit my post you can see that the element exists in the before code but is swallowed in rendering.

share|improve this question
add comment

2 Answers 2

up vote 2 down vote accepted

That's not one of the allowed HTML tags (is it even a real HTML tag?), so it will be removed. Unless of course it's in a code block, where it doesn't serve as verbatim HTML.

share|improve this answer
    
OK, thanks. I was assuming that if the tag weren't allowed (or in this case not valid) that SO would render it as HTML entities. I did not think that "discard" would be a valid option. –  T.Rob Nov 18 '11 at 20:48
add comment

Er, not sure if it is a bug or not. The XML elements don't belong in the code sample; the user might have been attempting to "force" prettify to colorize the code by C# rules...

<!-- language: c# -->

I removed them from the answer.

The original had them in the correct place, but the format was incorrect, so they wouldn't have been rendered by the usual rules (i.e., hide lefty brackety stuff that isn't indented four spaces).

share|improve this answer
    
<!-- language: c# --> isn't on the list of approved hints. Shouldn't that be <!-- language:lang-cs -->? –  Kevin Vermeer Nov 18 '11 at 19:38
    
@KevinVermeer: I copied that right from the help. –  Won't Nov 18 '11 at 21:07
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .