Straight double quotes vs curly double quotes


#1

In the past couple of weeks, I have seen a lot of new coding questions posted where the code pasted in shows:

“ ”

vs

" "

When helping someone, I usually copy/paste their solution into something like replit.com to see what their code does. Over the last 2 weeks, I have had to replace the curly quotes with straight quotes. Anyone else notice this? Is there an editor which uses curly quotes instead of straight quotes?


#2

This is a new feature (Typographer) that was enabled at the end of last month according to the two threads linked below. It seems Admins can disable it.

I would be a fan of disabling it because people are always going to post their code outside of markdown code blocks, and then all their quotes will turn into curly quotes and make it a pain for anyone to copy/paste/run in a code editor.



#3

Seems like it only shows up when people don’t “fenced” their code. Which is a pain because a lot of people haven’t learned how to do that yet (I also copy/paste into codepen).

"fencing code seems to stop this."

I think admins can edit a post to wrap code in fences, but they’re busy too. We’ll just have to be polite in asking OPs to edit their posts. :slight_smile:

(Edit: As @SkyC said. I should have read your post twice first instead of posting the same thing as you. :stuck_out_tongue_winking_eye: )


#4

What does that mean? When I attempted to search what this meant I just got a bunch of references to quotes about fences.
If you mean using an open quote and closing quote - isn’t that how they are always used?

Confused


#5

This can happen if keyboard language is changed. Having used the french keyboard I can attest that " " becomes “ ” on some computers.


#6

You’re right. I used a fancy term when I should have demonstrated.

Code fencing is when you wrap blocks of code in triple back-ticks. So, 3 of these bad boys: ```

In your post, you would start and end your code block like this:

    ```
    3 little backticks above

    // Heres's where your code goes

    3 little backticks below
    ```

Code fencing itself is something that Github uses (but might not be a Github invention) and is an addition to Markdown (which the fCC post editor window supports).


#7

Ok, thanks for explaining. I thought it related to quotes but now I understand it relates to backticks.
Yes backticks are tricky for the uninitiated. They work well on one line if what you want to format is one line, but if you have a multi-line block to format it’s best to use opening triple ticks on the first line, then start your text (or code or whatever) on the second line, then finish with closing backticks on their own line, as you demonstrated. I learned it the hard way after several code posts.


#8

Even if people paste their code in with the 3 backticks, I am still seeing the curly quotes sometimes.


#9

That’s probably user error, due to copying/pasting from somewhere with curly quotes.


#10

Well, I have been a member of the forum since January and have only seen the curly quotes in the last couple of weeks, so I think something has changed besides just user error. Wherever they are copying from, it must not be an error when they run there code.


#11

That is curious. I hope it’s just a fluke and not the norm. I haven’t seen quote marks changing in code, but I’ll definitely be looking for it now (especially in my own… would hate someone to copy/paste my code snippets and have them not work because of that).

Thanks for the heads-up. :slight_smile: