26

As seen in the title of What is the difference between -​- and - before a command option? two hyphens are converted to a single long dash:

hyphens

This is a problem when one considers that there is a difference between --foo and —foo (which isn't -foo). For commands and options, this conversion can make reading the title of the question difficult and lead to confused answers (and search engines?).

4
  • To bypass this: put an invisible space between the two hyphens.
    – gparyani
    Commented Dec 6, 2014 at 19:56
  • @damryfbfnetsi does that mess up other searching?
    – user289086
    Commented Dec 6, 2014 at 19:57
  • I found another example: Overload of operator -- (prefix) Commented Mar 7, 2015 at 0:01
  • see this answer for how to type a zero-width space in Windows. For me, the solution using the Chrome console worked.
    – Stibu
    Commented May 22, 2018 at 7:46

2 Answers 2

-12

This has been the case for years; since Stack Overflow was first released, IIRC:

Note that the fancy entities code (for post titles only, of course) is based on a simplified subset of SmartyPants.

  • Straight quotes (' and ") into “curly” ‘ and “ entities
  • Dashes (-- and ---) into &emdash; entity
  • Three consecutive dots (...) into … entity

-- Smart quotes in parentheses point the wrong way ("example") ["tst"] {"tst"}

5
  • The last two can be bypassed by putting invisible characters between the displayed characters. I think it's by design (because sometimes the characters are in fact needed); is it a bug?
    – gparyani
    Commented Dec 6, 2014 at 19:57
  • 1
    No. The intention is to allow normal folks to write attractive titles without deviating from normal ASCII conventions - and for that purpose, it works.
    – Shog9
    Commented Dec 6, 2014 at 20:02
  • 31
    Given that the double dash is syntactically significant in some situations, I think the utility of converting it to emdash is outweighed by the misleading titles it causes. It should be removed from the list of substitutions. Commented Mar 6, 2015 at 23:59
  • Maybe we could compromise and have two dashes go to an endash? That's what TeX does, IIRC.
    – Kevin
    Commented May 21, 2015 at 12:56
  • 4
    I appreciate good typography, and appreciate this conversion in most software and on most sites, but on programming websites where -- is real syntax that comes up in questions, this is an inappropriate and slightly harmful choice. I'd bounty, but there are no bounties here, and repeats keep being duped to this inactive thread... Commented Apr 4, 2019 at 15:43
10

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.

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

You must log in to answer this question.