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:
- install Google Chrome Canary ... note: will not affect your normal Chrome installation.
- go to stackoverflow.com
- click "Ask a Question"
- 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.
spellcheck
seems to be the one, but apparently it needs to be set since insertion (e.gc = $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 ;-)...
, 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 stuffautocorrect
tag and hoping you can quietly drop support for that at a later date.)