It's not just a browser thing. Apple Books does this with their e-books, which is infuriating if you're working with a coding book and just want to copy-paste stuff into your editor/terminal. You get something like: “ghci> putStrLn (pretty 10 value)” Excerpt From: Bryan O’Sullivan, John Goerzen, and Donald Bruce Stewart. “Real World Haskell.” Apple Books. When you only copied: ghci> putStrLn (pretty 10 value) Note th…
> aren't even the ASCII quote character; you get horrid unicode quotes
Why should they be ASCII, and what’s wrong with Unicode?
My go-to site for copying special symbols is Wikipedia, which is, of course, well-behaved: Dashes https://en.wikipedia.org/wiki/Dash Diacritics https://en.wikipedia.org/wiki/Diacritic Precomposed Latin characters https://en.wikipedia.org/wiki/List_of_precomposed_Latin_char... Currency symbols https://en.wikipedia.org/wiki/Currency_symbol Japanese typographic symbols https://en.wikipedia.org/wiki/List_of_Japanese_typo…
MS Word will autocorrect two hyphens into either an en dash or an em dash based on what it believes you were trying to type. So this: "em--dash" becomes this: "em—dash" while this: "en -- dash" becomes this: "en – dash"
En dashes are for ranges and sometimes for compound modifiers, like "billiard-ball–size hail" or "New York City–based attorney." Not sure who advised MS Word to turn two dashes into an en dash, ever, but it's not correct. Whether an em dash has spaces around it is a matter of style.
It's not just a browser thing. Apple Books does this with their e-books, which is infuriating if you're working with a coding book and just want to copy-paste stuff into your editor/terminal. You get something like: “ghci> putStrLn (pretty 10 value)” Excerpt From: Bryan O’Sullivan, John Goerzen, and Donald Bruce Stewart. “Real World Haskell.” Apple Books. When you only copied: ghci> putStrLn (pretty 10 value) Note th…
> aren't even the ASCII quote character; you get horrid unicode quotes Why should they be ASCII, and what’s wrong with Unicode?
I think they are talking a about styled quotes, the kinds that point inward, which a REPL won't interpret as an ASCII quote and will throw some type of Syntax error.
> aren't even the ASCII quote character; you get horrid unicode quotes Why should they be ASCII, and what’s wrong with Unicode?
I think they are talking a about styled quotes, the kinds that point inward, which a REPL won't interpret as an ASCII quote and will throw some type of Syntax error.
Ok but those are standard, valid characters like any others. Why are they ‘horrid’?
> plus a newline to make it run immediately I already mentioned this in another comment, but everyone should enable bracket paste mode in their shell to defend against this. https://cirw.in/blog/bracketed-paste
I always just type "#" first before pasting... That way it is just a comment I can inspect before running
Here, paste this into your terminal:
echo "hello"
echo "lol" ; sudo sl -rf /
(In case it's not obvious, the # trick will not help you.)
I think they are talking a about styled quotes, the kinds that point inward, which a REPL won't interpret as an ASCII quote and will throw some type of Syntax error.
Ok but those are standard, valid characters like any others. Why are they ‘horrid’?
> plus a newline to make it run immediately I already mentioned this in another comment, but everyone should enable bracket paste mode in their shell to defend against this. https://cirw.in/blog/bracketed-paste
Thanks for the safety net tip. I might be more methodical than most, but in copying commands from external sources (ie, ~anything other than my own code or notes), I paste into a local buffer to examine and confirm contents. I do this as both as a means to generate documentation as well as for hygiene per se -- and it occasionally helps to sanity check my intention and prevent a footgun.
Bracketed paste is basically a local buffer (that won’t be executed unless you explicitly do so).
I think they are talking a about styled quotes, the kinds that point inward, which a REPL won't interpret as an ASCII quote and will throw some type of Syntax error.
Ok but those are standard, valid characters like any others. Why are they ‘horrid’?
Because for some reason terminals are stuck in the 70ies and don't accept those characters as quotes. Anything but ASCII trips them up.
Seems such an obvious interface to innovate, but it seems to run into terminal wizards sense of purity.
This happened to me recently and it was pretty embarassing - I copied a two paragraph snippet from a psychology paper and the website put an ad for CBD oil in my clipboard above the paragraphs. The segment I copied was just long enough that it overflowed my chat window so I had no idea the insertion was even there and I sent it as-is. The recipient called me about two minutes later and said "hey, I think you've been…
That's kind of hilarious actually. This highlights the tension between the document-web and the app-web. What if the page is an image editor, word processor, spreadsheet? These app-web pages need custom logic for copy and paste. Unfortunately, bad actors (like what you found) ensure browsers cannot implement this stuff properly, because every feature is now a way to shove a new ad in.
>"the tension between the document-web and the app-web"
This is a huge factor in debates about things like the merits of CSS-in-JS, or the tradeoffs in "JAMstack"
architecture. Pick any polarizing facet of web development and odds are you'll find this tension at the heart of the opposing perspectives.