103

Chrome is adding support for the highly requested Mac text substitution feature where in the OS automatically converts smart quotes in input and textarea fields like:

printf("hello world\n");

into:

printf(“hello world\n”);  // Notice the quotes are not ASCII

Another example is automatically substituting three periods into an ellipsis:

function (...spread)

becomes:

function(…spread)

This makes it kind of hard to use Stack Overflow as it is no longer valid code.

For some reason this seems to only affect Stack Overflow. Other sites that have code editors like jsfiddle.net, codepen.io, jsbin.com, shadertoy.com, glslsandbox.com seem to be unaffected by this.


To test:

  1. install Google Chrome Canary ... note: will not affect your normal Chrome installation.
  2. go to stackoverflow.com
  3. click "Ask a Question"
  4. type 3 periods, "..."

What should happen:

   three periods get inserted

What happens instead:

   the three periods are immediately replaced by an ellipsis character


Supposedly pressing undo is supposed to undo the conversion from ellipsis back into three periods. That works on some sites, but not on Stack Overflow for some reason!

Also, adding the attribute autocorrect="off" is supposed to work as well, but that doesn't seem to work on Stack Overflow, at least when manually editing the HTML in the Chrome devtools.

Here's a bug report to the Chromium team, with a screen recording of this issue: Issue 978317: Auto 3 period to ellipsis conversion making it impossible to enter 3 periods on Stack Overflow

It would be good to figure out why Stack Overflow's editor is behaving differently than the other sites mentioned, and whether the Stack Overflow Markdown editor needs fixing or whether it is a Chrome issue - in which case we should request that it be fixed before Chrome 77 ships in a few weeks.

29
  • 1
    Don't know for recent versions of macOs, but I had to explicitly turn the feature on in the my Sierra's Keyboard Preference panel (maybe I did turn it off though). Also, worth noting that Safari does handle these case nicely, proposing user set replacements like Chrome, but disregarding smart-quotes and ellipsis substitutions.
    – Kaiido
    Commented Jul 9, 2019 at 3:24
  • 2
    Since all the other sites mentioned are working clearly something is special about stack overflow and its interaction with chrome 77 so it seems like it would be good to figure out what that difference is rather than have to have every mac chrome user manually workaround the issue.
    – user128511
    Commented Jul 9, 2019 at 3:27
  • 1
    Ah it's not what I was proposing at all no. I was just pointing out that to be able to repro, I had to change some settings, so that if others also have to, they know where to go), and also pointing out that Safari handles it correctly, so indeed there must be something odd in the interaction between SO's code and Chrome's one, but since Safari is able to handle it, I'd say it's more the beta feature of Chrome that needs a fix rather than all the website that did the same thing as SO.
    – Kaiido
    Commented Jul 9, 2019 at 3:30
  • 1
    spellcheck seems to be the one, but apparently it needs to be set since insertion (e.g c = $0.cloneNode(); c.setAttribute('spellcheck', 'false'); $0.replaceWith(c)). But one funny thing is that their own dev-tools tree view editor also suffers from this ;-)
    – Kaiido
    Commented Jul 9, 2019 at 3:41
  • 1
    AFAIA, these settings can be toggled on/off individually in each application under Edit → Substitutions. Perhaps you've disabled some of those for Safari, but they default to on for Chrome?
    – deceze Mod
    Commented Jul 9, 2019 at 6:40
  • 87
    I do a huge amount of data cleansing at work. Almost all cases of character encoding problems I come across are because the Mac wanted to get cute with characters.
    – Eric J.
    Commented Jul 9, 2019 at 7:12
  • 26
    When I had to work on a mac in the past, gosh I hated their paternalist ways of forcing things.. If I want to type ..., I mean that, if I would want I'd do it. It often assume it knows better than you, and you always have to disable all sorts of stuff
    – Kaddath
    Commented Jul 9, 2019 at 7:25
  • 5
    @MrLister macOS has a system-wide setting for that feature, and all programs that use standard OS-supplied text input widgets get to use that feature "for free". You are free to turn it off system-wide, or on a per-app basis.
    – deceze Mod
    Commented Jul 9, 2019 at 7:56
  • 3
    @MrLister I was not specifically talking about text processing, rather all sorts of boring stuff all over the place (it was some years ago already).. I guess it was a quite useless rant though
    – Kaddath
    Commented Jul 9, 2019 at 8:02
  • 3
    If you used VB.NET then the curly quotes would be entirely acceptable for enclosing strings. :) Commented Jul 9, 2019 at 8:54
  • 3
    @EricJ. Really? The majority of cases I come across come from Microsoft Office (usually Word) getting cute with characters. Macs simply don't have enough market share to move the needle IME. Commented Jul 9, 2019 at 12:13
  • 9
    It would be much better if Chrome stopped implementing changes that allowed the OS settings to override stuff in the browser. This is not the first time they've pushed some design thing from Mac OS that invariably becomes the new flavor of the month in other environments. My personal favorite design faux pas is collapsing scroll bars.
    – TylerH
    Commented Jul 9, 2019 at 14:28
  • 21
    FFS, seriously?! Chrome is becoming worse than IE was in assuming it can just do what it wants and have everyone else lump it. These useless, breaking, "cutsie" features piss me off no end. If you want to implement some crap like that by default, then at the very least have a well-publicised, standard way of opting out (and not by just abusing the autocorrect tag and hoping you can quietly drop support for that at a later date.) Commented Jul 9, 2019 at 20:20
  • 5
    @MichaelBerry Chrome has been worse in this regard than IE ever was for years Commented Jul 9, 2019 at 20:42
  • 2
    @chivracq You say you disagree but then say the same thing I said? Pick a side :-P
    – TylerH
    Commented Jul 10, 2019 at 14:59

2 Answers 2

15

You can turn this feature off by unchecking edit->Substitutions->Smart Quotes etc...

enter image description here

This appears to be the same as Safari except, at least for me, Safari defaults to having these features off

enter image description here

As for undo not changing the substitutions back that appears to be a long standing issue with S.O. implementing their own undo

0
-15

StackOverflow should not turn off autocorrect on the text fields, even though this means more user annoyance. Losing the ability to use autocorrect would be more annoying than improper quotes, as any typo left in text really distracts the user reading it.

3
  • 24
    Was your typo intentional? If so, well done.
    – Dash
    Commented Jul 10, 2019 at 18:03
  • What about in the runnable snippet fields at least?
    – zero298
    Commented Jul 12, 2019 at 2:37
  • @zero298 Google chrome should add a new setting for smart quotes, instead of connecting that toggle to the autocorrect function
    – Ferrybig
    Commented Jul 12, 2019 at 6:03

You must log in to answer this question.