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

Single quotes are rewritten as quotes in HTML block and Shortcode blocks #33813

Closed
jasmussen opened this issue Aug 2, 2021 · 3 comments · Fixed by #51123
Closed

Single quotes are rewritten as quotes in HTML block and Shortcode blocks #33813

jasmussen opened this issue Aug 2, 2021 · 3 comments · Fixed by #51123
Labels
[Block] HTML Affects the the HTML Block [Feature] Saving Related to saving functionality [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Bug An existing feature does not function as intended

Comments

@jasmussen
Copy link
Contributor

jasmussen commented Aug 2, 2021

Description

In some use cases one might need to use single quotes instead of quotes. It could be editorial (this bug report form suggests step by step instructions with 1. Go to '...') as one example. Or it could be technical, such as for use in shortcodes.

Originally reported here, the following shortcode is broken on save, as the single quotes inside the data attribute are rewritten to quotes:

[tagged_heading heading="h2" text="Lorem ipsum dolor sit amet <mark data-tooltip='tooltip'></mark> sodales dui."]

This is an issue both in the HTML block, and the Shortcode blocks:

Screenshot 2021-08-02 at 12 49 19

Screenshot 2021-08-02 at 12 47 41

Arguably neither block should rewrite/beautify their contents.

Step-by-step reproduction instructions

  1. Create a new post
  2. Insert an HTML block, and paste the code above
  3. Save, then reload the page.

The reload is necessary for the editor to reflect the saved content.

Expected Behavior

The single quote should stay intact.

Current Behavior

Observe that the content of the shortcode has been edited to replace the single quotes.

@jasmussen jasmussen added [Block] HTML Affects the the HTML Block [Feature] Saving Related to saving functionality [Type] Bug An existing feature does not function as intended labels Aug 2, 2021
@egornmore
Copy link

Found a fast-fix solution, which works for me. Single quotes will stay intact if they are placed on the first level and double quotes inside of the single quotes. So just swap them e.g. [tagged_heading text='Lorem ipsum dolor sit amet <mark data-tooltip="tooltip"></mark> sodales dui.']

@Thelmachido
Copy link

I was able to reproduce this as shown below:

Screen.Recording.2022-08-24.at.15.03.10.mov

WordPress 6.0.1

Gutenberg 13.9.0

Theme TT2

@Thelmachido Thelmachido added the [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later label Aug 24, 2022
@Rale379
Copy link

Rale379 commented Sep 30, 2024

I'm having a similar issue, but with the text inside a heading block.
In the editor, a single quote is shown. but, on the frontend, the quote is replaced by a smart (curly) quote.
If I use an HTML block and substitute the quote for and HTML entity - ' - the quote is preserved.
image
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] HTML Affects the the HTML Block [Feature] Saving Related to saving functionality [Priority] Low Used to indicate that the issue at hand isn't a top priority to address and can be handled later [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants