It would be nice if backticked code in question titles were rendered the same way they are in question bodies. Since there are so many questions with code in them I feel it would be a big plus. Example.

This would look a lot nicer in listings and on the page itself if the code strings were rendered as such.

Similar ideas discussed here.

  • I wondered whether it's disadvantageous, e.g. for SEO reasons or any other, to have inline elements within the heading; but no, I see that phrasing content (for example, <code>) is explicitly permitted. – ChrisW Jan 26 '11 at 2:08
  • 3
    possible duplicate of Fix Markdown/SmartyPants in question titles – Yi Jiang Jan 26 '11 at 2:08
  • it wouldn't be transformed at all in the <title>, only in the h1 and question listings – John Bachir Jan 26 '11 at 3:21
  • 1
    the question Yi Jiang linked has nothing to do with HTML title tags. The first suggestion there is, in fact, an exact duplicate of what you're asking for. – Pops Jan 31 '11 at 13:18
  • Hm, you're right. Not sure what I was thinking the first time I looked at it. – John Bachir Jan 31 '11 at 20:36

It may just be me, but in my opinion, good (great?) question titles shouldn't contain code snippets. Your question title here, for example, fits my definition of a relatively good title: concise, the question actually matches the title, good keywords for searching... Code snippets would have too many of the common language keywords, in this case: {raise, new, Exception} (not to mention the ubiquitous foo) for good search results. I'm not sure that having code snippets in titles is something to encourage.

  • 2
    In all fairness, I'm not sure what I would retitle your linked post as, though :)P – robert_x44 Jan 26 '11 at 2:18
  • 2
    There are lots of great questions that are about a particular keyword or snippet of code. You're saying we should discourage saying what the question is about in the title? – Mechanical snail Aug 17 '12 at 5:01

You must log in to answer this question.

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