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

Gutenberg: Ampersand character (&) in title displays & in editor and message #29391

Closed
alisterscott opened this issue Dec 13, 2018 · 10 comments
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Pri] Normal Schedule for the next available opportuinity. [Type] Bug

Comments

@alisterscott
Copy link
Contributor

alisterscott commented Dec 13, 2018

Tested that this happens in both wp-admin and Calypso Gutenberg for a simple site. It didn't happen on Gutenberg master (see screenshot below) or wp-admin on a Jetpack site

Steps to reproduce

  1. Starting at URL: https://wordpress.com/post or https://wpcalypso.wordpress.com/block-editor/post for a simple site opted in
  2. Type an & character in title and publish (eg. "Black & White")

What I expected

Title in editor and message shouldn't contain & as per Gutenberg core and Calypso Classic

What happened instead

Title in editor and message shows &

Browser / OS version

Chrome 70 on macOS

Screenshot / Video

Calypso:

calypso

wp-admin:

wp-admin

Gutenberg Master:

g master

Calypso Classic Editor:

calypso classic

Context / Source

#dogfooding

@alisterscott alisterscott added [Type] Bug [Goal] Gutenberg Working towards full integration with Gutenberg labels Dec 13, 2018
@vindl vindl added the [Pri] Normal Schedule for the next available opportuinity. label Dec 13, 2018
@gwwar gwwar added this to the Gutenberg Flow Polish milestone Jan 25, 2019
@mmtr
Copy link
Member

mmtr commented Mar 12, 2019

This is still reproducible with Gutenframe.

@joweber123
Copy link

Another report of this here: 15802960-hc

@gwwar
Copy link
Contributor

gwwar commented Oct 30, 2019

Still reproducible on wpcom. This is a wpcom issue only. #27825 may be related

@jeraldjuice jeraldjuice self-assigned this Dec 24, 2019
@jeraldjuice
Copy link

This is an escaping issue and applies to other entities as well.

Screen Shot 2019-12-24 at 12 43 54 AM

The data displayed in the areas affected is coming from the post revision data, which hasn't been normalized like the post data itself is (ie, /state/posts/utils.js). This means that the escaped entities leak through when ultimately displayed in the editor instance in the iframe.

Working on a fix from that angle.

@mmtr
Copy link
Member

mmtr commented Dec 24, 2019

Maybe related to #38362 which was solved recently in WordPress/gutenberg#19187

@jeraldjuice
Copy link

It looks like you're right; I'll open up a PR in Gutenberg for the sidebar link after publish. The revisions escaping issue might be applicable to #27825

@kaitohm
Copy link

kaitohm commented Dec 27, 2019

We have a similar issue happening with apostrophes: 2583624-zen

@mmtr
Copy link
Member

mmtr commented Dec 31, 2019

It looks like you're right; I'll open up a PR in Gutenberg for the sidebar link after publish.

I think we can apply the same fix than WordPress/gutenberg#19187 and replace unescape with decodeEntities:

https://github.com/WordPress/gutenberg/blob/ab8af23410f9f89f5a57064b43758b157f392d55/packages/block-library/src/navigation-link/edit.js#L83

The revisions escaping issue might be applicable to #27825

Yeah, it could help. But it seems the closing quote gets replaced with an HTML-encoded on the published view, so I wouldn't discard KSES as the cause of #27825.

@gwwar
Copy link
Contributor

gwwar commented Jan 8, 2020

Title issue fixed by @glendaviesnz in WordPress/gutenberg#19187. The publish link should be fixed in WordPress/gutenberg#19517

@gwwar
Copy link
Contributor

gwwar commented Jan 9, 2020

closing this out for now, we should pick up the other publish link fix in the next update round

@gwwar gwwar closed this as completed Jan 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Goal] Gutenberg Working towards full integration with Gutenberg [Pri] Normal Schedule for the next available opportuinity. [Type] Bug
Projects
None yet
Development

No branches or pull requests

7 participants