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

Editor: straight quotes don't filter to curly quotes on publish as expected #3353

Closed
lancewillett opened this issue Nov 6, 2017 · 3 comments
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended
Milestone

Comments

@lancewillett
Copy link
Contributor

Issue Overview

An amazing feature of the WordPress editing experience is you can enter "dumb" quotes, aka straight quotes or primes — and when the post is filtered for view with wp_texturize they automagically turn into curly quotes for proper typography.

Steps to Reproduce (for bugs)

  1. Make a new post with Gutenberg, I tested with v 1.6.1 and WP trunk (latest Safari on macOS)
  2. Publish and view the resulting post in the front-end

Expected Behavior

I expected ' to turn into ’ and " to turn into ”.

Current Behavior

Instead, the quotes stayed the same (straight primes).

Possible Solution

I'm not sure, but it could have to do with Gutenberg post content not being filtered properly through the built-in WP texturize functions.

Screenshots

Gutenberg editor view
screen shot 2017-11-06 at 09 58 41

After publishing on the front-end
screen shot 2017-11-06 at 09 59 02

Related Issues and/or PRs

Noticed this when debugging punctuation weirdness on https://ma.tt/2017/11/new-backpack-aer-fit-pack/

@lancewillett lancewillett added the [Type] Bug An existing feature does not function as intended label Nov 6, 2017
@lancewillett
Copy link
Contributor Author

Looking at the raw post HTML it looks like Gutenberg converts simple quotes into entities:

<!-- wp:paragraph -->\n<p>It&#x27;s been a great day so far (I typed a prime there.)</p>\n<!-- /wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p>This�ll be great (I typed a curly quote).</p>\n<!-- /wp:paragraph -->

So it's possible texturize is ignoring &#x27; since it already looks converted?

@aduth
Copy link
Member

aduth commented Dec 13, 2017

This appears to be another issue of React's default string sanitization for block serialization working against us, since the WordPress texturize step is not expecting these to be represented as entities.

A couple ideas:

Related issues with serialization:

@karmatosed karmatosed added this to the Merge Proposal milestone Jan 25, 2018
@mtias mtias added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Mar 7, 2018
@lancewillett
Copy link
Contributor Author

Re-testing after fixes with fd08045

Looks good! Texturize in the front-end output works as expected. Chrome latest on macOS, Gutenberg 2.6.0 and WP 4.9.5.

Editor:
screen shot 2018-04-09 at 09 54 11

Front-end output:
screen shot 2018-04-09 at 09 54 03

@aduth aduth mentioned this issue Mar 25, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants