Skip to content

Conversation

@hamvocke
Copy link
Contributor

@hamvocke hamvocke commented Jan 27, 2021

Feedback on meta shows that automatically converting quotes to smart quotes in rich-text mode doesn't spark joy.

The reasoning is sound. On a programming website quotes often occur in code samples. Converting them to smart quotes will break code samples and we all know how much people love copy/pasting code samples.

This PR removes the usage of a bunch of Prosemirror's input rules that could make developers' lives harder:

  • converting quotes to smart quotes (both, single and double quotes)
  • converting ... to …
  • converting -- to —

All of the above are used in code in some form: -- is a decrement operator, ... is used as the spread operator in JS and quotes are... quotes.

We should not try to be smart about these things. If people are adamant using smart quotes or typographically correct characters, they'll most likely know how to enter them (e.g. by using their operating system's settings or using Alt codes).

These input rules haven't been a deliberately requested feature anyways. I remember adding them as we were still in the prototyping phase and I didn't think much about it. Seems like the made it all the way to production because that's what good prototypes do.

If we find out that people want to keep these as an opt-in option, we can still bring them back as a setting for the editor or special sites on the network. For now: Let's get rid of them.

@hamvocke hamvocke added the enhancement New feature or request label Jan 27, 2021
@hamvocke hamvocke requested a review from b-kelly January 27, 2021 15:14
Copy link
Contributor

@b-kelly b-kelly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I added a test to main confirming that the smart quotes happen, so I could alter the test here to prove they don't happen.

Thanks for picking this up.

@b-kelly b-kelly merged commit 1cd5351 into main Jan 30, 2021
@b-kelly b-kelly deleted the remove-smart-quotes branch January 30, 2021 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

4 participants