Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 153 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Quite often there are posts that have some sort of HTML / XML-like markup that is relevant code to the question:

<asp:Label runat="server" id="WebFormsAreSo2005" />

New users will often post it like this:

Don't see the code example? That's because I didn't indent it by 4 spaces so it's hidden. This is a quite frequent problem for new people. Hopefully, someone will recognize the problem and fix it with an edit - but that's hard sometimes. Since in some cases it is completely hidden, it just looks like a question with no code sample. I've gotten in the habit of just click "Edit" on questions that deal with XML / HTML anyway to see if there is any hidden code because of this.

This often leads to "Show us your code", "What have you tried?" etc. comments. With other languages it's fairly easy to notice there is a formatting problem, but with this particular case it just disappears.

Someone might be precognitive and will make the correct edit, and point the OP to the markdown editing help, but that isn't always the case. Yes, we all know you are suppose to select your code and click the Code Sample format button. You can even click the question mark for some great help that illustrates exactly how to fix it, but that just isn't happening for new people. Right out of the gate these new users are probably starting off with a question that has several down votes and a barrage of comments.

Can we improve the code formatting experience for new users somehow?

Alternatively, can we change the way HTML/XML is interpreted such that it is at least visible so it is clear that something needs to be fixed?

share|improve this question
Honestly, this just comes across as laziness / lack of effort to me most of the time (sorry for being cynical). If they don't notice the big preview area (that's constantly updating below where they type the question) is missing the most important part of their question, I'm not confident that their contribution is going to be worthwhile </rant> – jadarnel27 Aug 16 '12 at 16:50
@jadarnel27 Perhaps, but I want to give people the benefit of the doubt. I've seen 5+ edit histories of the OP trying their damnedest to make the code visible/formatted. I think it's mostly uncertainty, perhaps with the occasional bit of laziness. – vcsjones Aug 16 '12 at 16:57
Not sure how viable this is. Since you can use (some) HTML in your posts, how will you build a viable system to detect the difference between markup the user wanted to use and markup the user intended to be displayed? – Al E. Aug 16 '12 at 17:26
@jadarnel27 Agree. BTW, where is your opening <rant> tag? Did you forget to escape it? :) – bfavaretto Aug 16 '12 at 17:33
@TartLevee I would assume that people with little reputation aren't trying to use HTML to format their post. I use HTML so rarely (if at all) to format my posts that I hardly even see a point of having the editor interpret it as HTML. The MD functionality itself provides everything I need. – vcsjones Aug 16 '12 at 17:36
@vcsjones: sup and sub are things that markdown has yet to support. And br tag is sometimes useful. Agree that HTML tags are not used most of the time, though. – nhahtdh Aug 16 '12 at 17:43
I actually find quite frequently that new users us html to format their posts rather than markdown. The amount of times I have to remove <br/> tags is surprising at least. – Bart Aug 16 '12 at 17:44
@nhahtdh and quite honestly I don't think I have ever used them. Even if I did, I would trade that for fixing this problem; and possibly suggest that it could just be an extension to mark-down. – vcsjones Aug 16 '12 at 17:45
@bfavaretto Ha! You caught me. Well played =) – jadarnel27 Aug 16 '12 at 17:48
I also often "edit" questions to check for missing code blocks. I'm not sure what the actual answer is, though. Perhaps a diff between source/render and a warning if it "seems" like something important went missing? (For an undetermined value of "seems" still.) – Dave Newton Aug 16 '12 at 18:13

You must log in to answer this question.

Browse other questions tagged .