55

Consider this question:

is x-- > 0 && array[x] well defined behavior in c++?

Unfortunately, the question title is displayed on SO as:

is `x— > 0 && array[x]` well defined behavior in c++?

There are two issues here:

  1. Less severe, the backticks are displayed verbatim and don’t delimit a code span. Not very nice but bearable. On the other hand, MathOverflow has this really nice math mode even in titles – why not also introduce this on SO for code?
  2. The -- operator is transformed into an em-dash. This is slightly misleading and simply unnecessary. I am all in favour of using SmartyPants (or whatever SO uses) to glam up the question title typography. But this shouldn’t go at the cost of correctness.

So I suggest allowing limited Markdown in titles (e.g. as in comments?) or at least fixing the formatting bug.

9
  • 4
    "So I suggest allowing limited Markdown in titles (e.g. as in comments?)" - Agreed
    – jjnguy
    Commented Oct 28, 2010 at 15:52
  • 4
    Now I'm wondering if I can add em-dash as an alias for the decrement operator in C...
    – user27414
    Commented Oct 28, 2010 at 15:55
  • 2
    Probably worth noting that a search for the title as-written still finds the question. The double-dash is converted to an em-dash during rendering, just as the double-ampersand is converted to && - it affects the final display (and possibly Google indexing) but not the internal title.
    – Shog9
    Commented Oct 28, 2010 at 21:52
  • +1 because I wanted to italicize a metasyntactic variable on English.SE in a title... and status-declined, schmatus-declined: even gods can change their minds, so there's hope ;-) Commented Feb 8, 2011 at 20:57
  • 6
    “Slightly” misleading ? It is totally wrong ! Give that garbage to a C++ compiler, you will see. Commented Dec 7, 2013 at 20:26
  • How about providing an escape way ? Commented Dec 7, 2013 at 20:29
  • The question title should be "-- -> —, yes or no?" Commented Sep 9, 2015 at 17:00
  • 3
    … for those of us keeping track: More than eight years and ~ 10 duplicate bug reports later, this is still not fixed. Commented Jan 14, 2019 at 16:55
  • 11 years later: It's fixed now.
    – Mendhak
    Commented Sep 1, 2021 at 20:19

4 Answers 4

15

We have now disabled all Smarty-like modifications text in titles.

From now on, the title text saved for the post is the title text that will be displayed.

If folks want em-dashes (ALT-0151) and fancy quotes (ALT-0145 through -0148) to appear in titles, they are welcome to add them. But we won’t convert it automatically any longer.

That said, we have no plans to introduce markdown in titles.

we’re no longer the
smarty-pants who makes changes
to typography

3
28

I'm not sure we want markdown in titles. However, I think -- -> — is not appropriate for a programming site.

13

Even given the current MarkDown support in comments (bold, italic, code, links), the only one of those I would want to have in the question titles is code.

I think, given that SO is a programming site, code is reasonable to allow in titles. Regardless of whether or not this would carry a fixed-width style of some kind, it should disable any character transforms such as -- being converted to an em-dash.

-7

We definitely don't want Markdown in question titles

  • it's too processing intensive
  • it's additional complexity and overkill IMO

And how do we tell the difference between these two titles:

How do I "accept" an answer-- where do I click?

and

is x-- > 0 && array[x] well defined behavior in c++?

11
  • 4
    So you are going to leave the functionality that converts -- to ?
    – jjnguy
    Commented Oct 28, 2010 at 21:29
  • 11
    Neither of those titles contain code -- auto-code-interpretation is way too much. Allow it within backquotes and that's it.
    – Jon Seigel
    Commented Oct 28, 2010 at 22:25
  • 9
    trivial: there is no difference. Let the users be explicit: only filter out backtick-delimited sections. This should be straightforward (and is already done for $…$ on other SE sites). Commented Oct 29, 2010 at 7:23
  • 1
    Or give us another delimiter to use in titles besides backtick?
    – jcolebrand
    Commented Feb 7, 2011 at 18:31
  • 2
    What is $...$? Commented Feb 16, 2011 at 17:19
  • 7
    Markdown in titles too processor-intensive? We just need a backtick in the titles to delimit code - it's trivial to implement! And I'm sure it's not processor intensive, it can't be. Commented Jan 7, 2012 at 23:18
  • 2
    @Camilo, indeed, if it's processor intensive, then do it in Javascript like SO already does in the preview window. "Performance" is a canard.
    – Kirk Woll
    Commented Nov 22, 2012 at 7:03
  • You force the user to type How do I "accept" an answer -- where do I click?, with an extra space, as suggested here
    – Eric
    Commented Aug 16, 2013 at 15:57
  • How do we tell the difference ? By thinking. With a human brain. Commented Dec 7, 2013 at 20:30
  • 13
    You can't tell. So don't substitute characters. If the author uses a hyphen, show a hyphen. If the author uses an em dash, show an em dash. If the author uses a ☂, show a ☂. Commented Sep 9, 2015 at 7:58
  • @PaulDraper Do you mean "If the author uses a ☂, show a ☂,"
    – Spikatrix
    Commented Sep 9, 2015 at 12:22

You must log in to answer this question.

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