Possible Duplicates:
Where is the FAQ?
How do I get my code blocks formatted?

I inserted some code (not as code, just copy and pasted) into one of my answers and noticed that the code got mangled. I tried to fix it but then some of the text was mangled.

All sorts of mangling occurred and the mangled text was made to look like code.

The code that got messed up via copy-and-paste all ran together, like this:

(without JavaScript) ~~ same name for both buttons.

on your .aspx page, add a second button: in your Controller: // POST: /Home/Edit/5 [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(Movie movieToEdit, string submitButton) { if (submitButton == "First") et cetera

This is so frustrating.

Why not just let me type raw HTML and you can parse it for anything bad?

P.S.: I noticed noscript in angle brackets in my question vanished. I dropped the angle brackets and bolded the word "noscript". I'm guessing I could have used entities for the angle brackets.

On the other hand, Stack Overflow could have simply HTML encoded them.

marked as duplicate by fretje, random, perbert, alex, balpha Jan 14 '10 at 7:59

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.

  • 1
    please check this: meta.stackoverflow.com/editing-help – fretje Jan 13 '10 at 23:59
  • 2
    ...which is linked by the question mark you see above the editor. Also: don't you think that tagging as "bug" is a bit too fast after being around for one day...? – Arjan Jan 14 '10 at 0:22
  • @Arjan van Bentem ... I've been around computers since 1967 ... so imnho there is nothing wrong with calling something that acts like a bug, a bug ... YMMV ~~ I could call it a design flaw: see "Don't Make Me Think" by Steve Krug; visit his web site at sensible.com. – gerryLowry Jan 14 '10 at 0:28
  • @ fretje ~~ thank you for the link .... perhaps the bug is not a bug after all .... I'll reserve judgement for now .... regards – gerryLowry Jan 14 '10 at 0:31
  • 3
    I think "Don't Make Me Think" is the motto for far, far too many programmers already. – womble Jan 14 '10 at 1:02
  • I'm irresistably reminded of a comedian, 'Con the Fruiterer', on Australian television a few years -- no, decades -- ago. He got great mileage out of exclamations of "How embarrassment!" – pavium Jan 14 '10 at 6:21
  • @pavium That's Effie from Acropolis Now – random Jan 14 '10 at 6:37

screenshot with freehand circle

  • paste your code
  • select it
  • click the little binary icon (pictured)
  • profit!
  • Thanks Shog9! I couldn't figure out why the image wouldn't load.. :) – Ether Jan 14 '10 at 0:31
  • Didn't load because you had the page as the image source. You needed the image path instead. – random Jan 14 '10 at 0:37
  • 3
    Image hosting sites scare me. I'm all traumatized now. Gonna go drink heavily to ward off flashbacks... – Shog9 Jan 14 '10 at 0:41
  • Yeah it was pretty obvious after Shog made the change, but damned if I couldn't figure it out... I swear it looked fine in the original preview, I swear!!! – Ether Jan 14 '10 at 0:45

Why not just let me type raw HTML and you can parse it for anything bad?

That's what it does. Or rather, it attempts to remove any markup that's not explicitly allowed - that includes dangerous HTML, HTML that isn't considered necessary for composing text on the site, and markup that isn't HTML at all. Whatever's left is passed through in the markup generated by the site and rendered by the user's browser - Markup (the site's text-formatting language) allows the use of embedded HTML for formatting purposes.

If you want to post code that looks like markup but don't wish it to be interpreted as such (and either stripped or included verbatim in the final page), then do as fretje suggests and read the instructions: you'll find two ways of escaping it, one intended for

<blocks> <of> <code>, 

the other for <inline>. Markup posted within either of these will be displayed to the user as though it were just text.


There's a code button; press it - that does the work (indent) to make it work

<without><asp:whatever>any escaping</asp:whatever></without>

Simply, markdown has specific syntax for things like code <like this> - there is a panel on the right hand side that explains.

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