Skip to content

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

Closed

Description

@lancewillett

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/

Activity

  1. added
    [Type] Bug
    on Nov 6, 2017
  2. lancewillett commented on Nov 6, 2017

    @lancewillett
    MemberAuthor

    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?

  3. aduth commented on Dec 13, 2017

    @aduth
    Member

    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:

  4. added this to the milestone on Jan 25, 2018
  5. added
    [Feature] Writing Flow
    on Mar 7, 2018
  6. lancewillett commented on Apr 9, 2018

    @lancewillett
    MemberAuthor

    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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    [Feature] Writing Flow[Type] Bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions