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

Add a polyfill for the normalize function to support older browsers #13157

Closed
Zodiac1978 opened this issue Jan 1, 2019 · 3 comments
Closed
Labels
[Feature] Paste Internationalization (i18n) Issues or PRs related to internationalization efforts

Comments

@Zodiac1978
Copy link

Describe the bug
Following the advise from here to open an issue: #7105 (comment)

Related: #433 #6958

Pasting NFD text will break the internal search in WP and can break the search on the website (like in Firefox), spellcheck, and the display (showing the character + combining character side by side and not overlaying it, Firefox is failing here for example).

And it can happen all the time that apps output NFD text and not NFC, like the W3C is recommending.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://core.trac.wordpress.org/ticket/30130
  2. Download the PDF
  3. Open it in Preview on Mac
  4. Copy the text
  5. Paste it in the editor, for example in a paragraph
  6. See the broken search in browser and in WP, broken spellcheck, maybe display (Firefox) in all browsers who do not support the normalize feature: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize

(This also affects other areas: Pasting the text in the title would break the transliteratin from "ü" to "ue" in the slug for German sites for example.

Expected behavior
Should work in all browsers. Browsers with no support should use a polyfill.

Screenshots
Broken display in Firefox with NFD text:
tinymce-front-page-screenshot-paste-1

Desktop (please complete the following information):
See link above for problematic browsers with no support:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize

Sometimes people do not have the latest OS and therefore not the latest browser version!

Additional context
This is not a Mac specific problem but because of the filesystem HFS+ which uses NFD it is mostly a Mac problem. But every bad program can output NFD instead of NFC and all web CMS should normalize user input to NFC in this case (as recommended by the W3C).

If you need more information about NFC and how non-NFC is breaking WP, please ask specific question and I am happily try to answer them. Thank you very much!

@swissspidy
Copy link
Member

Looks like https://github.com/walling/unorm could be used, but it hasn‘t been updated in a while.

@Zodiac1978
Copy link
Author

Yes, @swissspidy - this was mentioned before:
tinymce/tinymce#1971 (comment)
https://core.trac.wordpress.org/ticket/30130#comment:28

but it hasn‘t been updated in a while.

Maybe just a stable script?

@swissspidy swissspidy added Internationalization (i18n) Issues or PRs related to internationalization efforts npm Packages Related to npm packages labels Jan 2, 2019
@gziolo gziolo added [Feature] Paste and removed npm Packages Related to npm packages labels Oct 20, 2019
@Zodiac1978
Copy link
Author

Three years later we don't support IE anymore and WebView Android seems to be not relevant enough to fox anything here.

The mentioned library https://github.com/walling/unorm has updates in 2019 (1.5 and 1.6) but since then no one tried to updated this ticket here and since then there are no updates anymore.

It seems that we could close this issue due to missing relevance or interest from the Gutenberg devs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Paste Internationalization (i18n) Issues or PRs related to internationalization efforts
Projects
None yet
Development

No branches or pull requests

3 participants