ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.65k stars 3.71k forks source link

ckeditor not working properly with latest chrome version Version 75.0.3770.90 , but working fine with previous versions of chrome and firefox #1823

Closed yravinderkumar33 closed 5 years ago

yravinderkumar33 commented 5 years ago

Is this a bug report or feature request? (choose one)

🐞 Bug report

💻 Version of CKEditor

CK5

📋 Steps to reproduce

When i'm trying to setData into the editor it's giving out this error . This issue I'm getting only with the latest version of Chrome Version (75.0.3770.90). With previous version it's working fine .

Screenshot 2019-06-18 at 11 26 45 AM

📃 Other details that might be useful

Mgsy commented 5 years ago

Hello, I can't reproduce your issue. Can you provide exact steps to reproduce the problem?

yravinderkumar33 commented 5 years ago

I'm using CKE5 List of plugins that am using 👎

Screenshot 2019-06-19 at 9 59 46 AM

when i try to set this data into the ckeditor it's giving that error <figure class="image"><img src="/assets/public/content/do_11274189938471731211/artifact/51mmhlbsyel._sx258_bo1204203200__1555407640230.jpg" alt="do_11274189938471731211" data-asset-variable="do_11274189938471731211"></figure>

Screenshot 2019-06-19 at 10 03 35 AM

Note:- this is only happening with the latest version of chrome .

Mgsy commented 5 years ago

I'm sorry, but still I can't reproduce your issue. Does it happen only with this specific data? Or the editor crashes every time you try to use editor#setData? Can you clone ckeditor5-build-classic, follow the readme and check whether the problem exists there?

yravinderkumar33 commented 5 years ago

No such error is mentioned in the readme. Please follow these steps to reproduce the issue 1 - "@project-sunbird/ckeditor-build-font": "^1.0.5", ( this is my custom build that I'm using). 2- `import { Component, OnInit } from '@angular/core'; import * as ClassicEditor from '@project-sunbird/ckeditor-build-font'

@Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent {

editor=ClassicEditor; config = { toolbar: ['bold', '|', 'italic', '|', 'underline', '|', 'numberedList', '|', 'fontSize', '|', 'ChemType', '|', 'mathtype', '|', 'subscript', '|', 'superscript', '|', ], fontSize: { options: [ 9, 11, 13, 15, 17, 19, 21, 23, 25 ] }, image: { toolbar: ['imageStyle:alignLeft', 'imageStyle:full', 'imageStyle:alignRight'], styles: ['full', 'alignLeft', 'alignRight', 'alignCenter'] }, isReadOnly: false, removePlugins: ['ImageCaption'] }

} `

3 - template code <ckeditor [editor]="editor" [config]="config"> </ckeditor>

4 - in my custom build I'm using @wiris/mathtype-ckeditor5 plugin which is causing this issue with the lastest version of chrome . if i disable it everything works fine . 5.

Screenshot 2019-06-20 at 11 30 28 AM Screenshot 2019-06-20 at 11 30 39 AM

![Uploading Screenshot 2019-06-20 at 11.30.49 AM.png…]()

mcagigas-at-wiris commented 5 years ago

@yravinderkumar33

My name is Manuel, Plugin Manager at MathType.

We have detected this issue and we are working to fix it. We will back to you when the issue is fixed.

Thanks for your feedback.

vinukumar-vs commented 5 years ago

@manuelwiris Thanks for your quick response.. Really appreciate. This was the major prod issue in our product after Chrome 75 release has happened 12 days before. @yravinderkumar33 @Mgsy

Mgsy commented 5 years ago

I'm closing it as the problem isn't related to CKEditor 5.

vinukumar-vs commented 5 years ago

@Mgsy Can you please share your inputs/findings on this. It will really help us to debug more. Few clarifications:

  1. This issue is reproducible only with Chrome 75. Are you able to reproduce?
  2. If the issue is reproducible with Chrome 75, then what may cause this issue(share your findings).

@manuelwiris @yravinderkumar33

xaviripo commented 5 years ago

Hi, I'm Xavier, plugin developer at MathType.

Just to close the topic, we have tracked the issue down to a bug in Chrome. As per the thread, the fix in Chrome should be published in the coming days. Meanwhile, I've pushed a fix that should do.

@yravinderkumar33, please update your node_modules and confirm that it is working for you.

venkateshwarans commented 5 years ago

@xaviripo , as you said, it is a regex issue on chrome's end. toView(e) { let t = new DOMParser; e = (e = e.replace(/&.*?;/g, e=>{ let i = t.parseFromString(e, "text/html").body.childNodes[0].data; return "<" == i || ">" == i ? e : i } )).replace(/[\u00A0-\u9999]/gim, e=>"&#" + e.charCodeAt(0) + ";"); const i = this._toDom(e); return this._domConverter.domToView(i, { keepOriginalCase: !0 }) }

The above piece of code is matching the s character. For reference: https://regexr.com/4gepe. May I know what is the fix from your side? Would like to locally test it before fetching a new pull as our product uses custom build.

xaviripo commented 5 years ago

Changing /[\u00A0-\u9999]/gim to /[\u00A0-\u9999]/gm did the trick, as we actually don't care whether the non-ASCII characters are upper case or lower case, we just want to match the whole indicated range (\u00A0 through \u9999).