Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot enter ' in paragraph block #35705

Closed
j-maas opened this issue Oct 16, 2021 · 10 comments
Closed

Cannot enter ' in paragraph block #35705

j-maas opened this issue Oct 16, 2021 · 10 comments
Labels
[Block] Paragraph Affects the Paragraph Block [Status] Not Implemented Issue/PR we will (likely) not implement.

Comments

@j-maas
Copy link

j-maas commented Oct 16, 2021

Description

I want to enter bank credentials on the website for an association. The association's name contains an apostrophe, but since most banks only support ASCII, I'd like to write the name in the bank details with a single quote (').

Single quotes get converted to apostrophes in the preview, and there is no way to escape the single quote.

This issue is related to #15816, but I'm concerned with this specific use case and as far as I understand this other issue is concerned with a bigger problem.

Step-by-step reproduction instructions

  1. Write Association' Name in a paragraph block.
  2. Preview: It is written Association‘ Name.
  3. Go to HTML mode and write Association' Name.
  4. Preview: It is written Association‘ Name.
  5. In HTML mode, write Association' Name.
  6. Click somewhere else.
  7. The ' is converted to a single quote, such that the block reads Association' Name with the same issues as above.

Screenshots, screen recording, code snippet

No response

Environment info

  • WordPress: 5.8.1

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@j-maas
Copy link
Author

j-maas commented Oct 16, 2021

If there is a way I can contribute for this issue, please direct me to where to start looking. :)

@stevenlinx stevenlinx added the [Block] Paragraph Affects the Paragraph Block label Oct 18, 2021
@j-maas
Copy link
Author

j-maas commented Nov 19, 2021

I found a workaround: Using the "Custom HTML" block I can use ' to display the single quote without it getting converted.

@kathrynwp kathrynwp added the [Status] Not Implemented Issue/PR we will (likely) not implement. label Jul 12, 2022
@kathrynwp
Copy link

Thank you for the report. Since you were able to find a workaround, and since there have been no other reports of this issue from others, I'm going to go ahead and close it out.

@kathrynwp kathrynwp closed this as not planned Won't fix, can't repro, duplicate, stale Jul 12, 2022
@RatzeR
Copy link

RatzeR commented Aug 5, 2022

@kathrynwp I just found this bug and can confirm, that this bug is still not solved.

For example:

  • It is not possible to add a apostrophe in a paragraph
  • It is not possible to add a apostrophe in a headline in a cover block

@kathrynwp
Copy link

Hi @RatzeR I've been able to add an apostrophe within both a paragraph and cover block without any issues.

Could you please provide the following so I can investigate further:

  • Exact steps to replicate the issue
  • What version of WordPress are you using?
  • If you also have the standalone Gutenberg plugin active, what version is it?
  • Is the issue present with all your plugins temporarily deactivated? You can use the Health Check plugin for this, which will not change your live site – https://wordpress.org/plugins/health-check/
  • What theme are you using?
  • Is the issue present with a default theme? Again, you can use the Health Check plugin for this.

@RatzeR
Copy link

RatzeR commented Aug 9, 2022

Hi @kathrynwp,

maybe may description was a bit unclear. Adding an apostrophe in the backend is possible, but in the frontend no apostrophe is shown. They are converted to a instead of a '.

Steps to reproduce

  • Create a new page
  • Add a Cover Block
  • Write a text as a headline with an apostrophe, for example Dem'o
  • Optional: Add a paragraph block below the cover and add the same text
  • Save the page
  • Open up the frontend
  • Check the apostophes - they are converted to a instead of a '

Wordpress Version

  • Wordpress 6.0.1

Gutenberg Version

  • No extra plugin, just the Gutenberg Version shipped with this Wordpress version

Plugins / Themes

  • All deactivated with the Health Check Plugin, used Theme: Twenty Twenty
  • Also reproducible with my own theme, so this is not a bug caused by the theme

@kathrynwp
Copy link

kathrynwp commented Aug 9, 2022

Thanks for the additional information, @RatzeR

I do think it's the expected behaviour that the editor converts straight quotes/apostrophes to curly quotes/apostrophes; the pre-Gutenberg editor also did this.

@RatzeR
Copy link

RatzeR commented Aug 9, 2022

@kathrynwp I just found the file where it is implemented: wp-includes/formatting.php

But I do not really understand, whats the reason behind this. Why convert the apostrophe to ’ instead of '?

@kathrynwp
Copy link

kathrynwp commented Aug 9, 2022

@RatzeR I don't know the answer behind that, but you might want to ask in the #core channel in WordPress.org Slack to see if someone remembers why that is.

@j-maas
Copy link
Author

j-maas commented Aug 10, 2022

This is likely because people tend to write single quotations 'like this', since on the keyboard the real quoation marks are missing. The algorithm probably just looks whether the simple mark is at the start or the end of a word and converts it to the starting or ending quotation mark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Paragraph Affects the Paragraph Block [Status] Not Implemented Issue/PR we will (likely) not implement.
Projects
None yet
Development

No branches or pull requests

4 participants