-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Integration with Grammarly #267
Comments
I also use Grammarly and recently with @szymonkups we were checking why one manual test (http://tests.ckeditor.dev:1030/build/amd/tests/engine/view/manual/immutable) is failing on my computer. It appears that it was Grammarly who insert unexpected text node with a space between "foo" and "bar". |
So it is not only about making external manipulation (Grammarly) working fine with CKEditor, but also about CKEditor working fine with external manipulation. |
I can see that Grammarly doesn't work with any of the new editors (ProseMirror, Draft.js) and it's not a surprise. You must not carelessly modify someone's DOM and Grammarly creates its own spans in the content. Currently, CKEditor 5 totally blocks Grammarly which is a nice behaviour. For instance, Draft.js and Slate totally breaks when Grammarly is used. CKEditor works fine thanks to the editing engine architecture, which simply rejects mutations which don't have handlers. Also, thanks to the architecture we could think of actually supporting Grammarly by one of these ways:
|
I support @Reinmar on this. We can't expect that every plugin doing anything with our editable contents works fine. I was about to ask how it works in other editors because I was not suspecting it to work without any additional integration. However, I suppose that it should work with "ACF=true" converter, that is the converter that converts all unrecognized elements and attributes to the same elements and attributes in model. I also think it would be the best if we had integration with Grammarly (or any other 3rd party service) done on our terms, using possibilities and functions that we created by introducing all the model<->converters<->view architecture. |
That converter would need to handle mutations caused by adding those spans. This is something more than just converting any DOM to the model and back. You also need to be aware of how that DOM is being created. |
Keep in mind, that Grammarly plugin would not have to modify model but view. Converting from view to DOM is easy, then, but it would need some plugin to handle adding extra view spans and clearing them. Operating on view is more similar to operating on DOM than operating on model. And you would not need to introduce converters. I am not sure how it would work if you would remove some letters from a |
I'm in touch right now with the Grammarly support to understand what could be done in such case. If there will be no useful outcome out of this contact, it seems that it is doable to disable Grammarly in a specific element by adding this attribute to it: |
@fredck using |
Thanks for the confirmation, @pjar! I'm still waiting for Grammarly to give any feedback on this, though. I'll ping them once again. |
Ok, here is the log of my contact with the Grammarly support so far:
The conclusion is that.... we don't know. We don't know if this will be solved at their side. If so, then we don't know when and how. So, for now, we can just keep waiting. |
We could also ping the guys (@A-gambit, @alexander-yakushev, @blacktaxi) directly. As we can see the "forwarding" didn't go particularly well, so we don't know what the team actually received. E.g. I'd be interested in hearing their opinion about the options that they consider viable. Having distorted one-way communication we may end up nowhere if we didn't understand each other correctly. |
Unfortunately, this issue is still open. We recently received some issues from users who use CKEditor 5 and Grammarly. |
By the way, this is related: https://github.com/grammarly/contenteditable |
Actually, on my Chrome, it doesn't check spelling on the entire website? I created a textarea and it didn't check the spelling in there too. |
OK, we should read through facebookarchive/draft-js#616. Edit: it was fixed on Grammarly side.
So we should contact them again. |
I'm adding this to the current milestone so to remember to discuss this once again and take final actions. |
I've contacted their support for yet another time. If we'll not have their attention still, I'm afraid we'll have to go the dirty way and use the |
Hi Frederico, Thank you for bringing this up once again, and for your patience. And sorry it took us so long to respond. For now, the right thing to do seems to be for Grammarly to not touch CKEditor DOM. We are going to implement and release this change in the coming weeks in Chrome. Safari and Firefox usually have a much longer release cycle because of the store review process, so you can expect a delay of additional two to four weeks there. In the longer term, we would very much like to work in harmony with CKEditor. We're going to look into how we can make this happen. We don't currently have a timeline for this though. I will keep you updated on our progress. |
Hey @blacktaxi! Thanks for the reply. Great to hear that you plan to work on this :) How do you plan to check whether an editable element belongs to CKEditor? We have two major versions of CKEditor right now – CKEditor 4 (which demo you can see on https://ckeditor.com) and CKEditor 5 (which demo you can see on https://ckeditor5.github.io). Both these editors use different classes to mark their editable elements. These are:
There's also a question whether Grammarly needs to be disabled for CKEditor 4 too. It definitely cannot work with CKEditor 5 (due to its architecture), but CKEditor 4 is more forgiving. WDYT @mlewand and @fredck? |
I think this is just for CKEditor 5. In CKEditor 4 the data model is the DOM itself, so changes made by external applications, especially the kinds of changes done by Grammarly, are usually fine. |
Turns out that Grammarly may cause some issues in CKE 4 as well: https://dev.ckeditor.com/ticket/14332 and https://jira.xwiki.org/browse/CKEDITOR-117. This is a special case where the full page mode is used so in most cases Grammarly may be working just fine. |
Just want to be sure that Grammarly will be focused on fixing the situation with CKEditor 5 only asap. That's why I would avoid talking about CKEditor 4 at this point, because things should be ok there. If we make the scope bigger, we make things slower. |
Yes, it seems that Grammarly works with CKEditor 4 fine most of the time. This is why we haven't blacklisted it in the past. I also think that for now we should only focus on fixing the incompatibility with CKE 5. We can proceed with this plan and then see whether we need to do anything about CKE 4. @Reinmar, we usually do check for definitive class names to discern different editors. Thanks for the tip! |
I found one scenario when Grammarly is running on element with a The scenario looks like this:
Of course, a simple workaround is to not have If we can't think of a reason to load such HTML, then it's simply not recommended to add the |
The only use I can see for this is to mark elements that the system wants them to be RTEs. Sounds like a weird way for it though, as this can be done with classes or even custom attributes, without risking to give at the hands of end users a full contenteditable enabled, ready-to-be-messed-up element. But still, I think I've seen something like this in the past... but let's wait for people to come with such cases before we think about doing anything about it. |
Might be good to document it in a best practices page: not recommended to use contenteditable as an identifier for containers pending RTE initialization. I only butt in because that's how I'm doing it with CKEditor4 |
Yeah... cause we're automatically hoisting elements which have We're gonna add a note in the docs: https://github.com/ckeditor/ckeditor5-editor-inline/issues/27 |
I ended up turning off automatic initialization for my use case, but still used the convention afterwards. |
@blacktaxi - I have a very strange issue with CKE 4 where Grammarly seems to be appending the first word it finds on the page to the end of the text editor. We have 2 text editors on the page and it appends it to the end of both the word "Schedule" which is the first menu item at the top of the page (basically, the first text item in the html body). |
@blacktaxi - I just got permission to share this video of the issue: https://youtu.be/GUBbycBDPOY?t=44s EDIT: watching the video again, I noticed a small third-party added button that says "Schedule" and I think that may be what the issue is in this specific case (not Grammarly). |
@tisdall I know that CKEditor 4 was mentioned in this thread, but we decided to focus here on CKEditor 5 (which is a completely new project). If you have issues with Grammarly and CKEditor 4 please either report them directly to the Grammarly team or on https://github.com/ckeditor/ckeditor-dev. Thanks! |
Hi @blacktaxi, do you plan to work on better integration with CKEditor 5 or in general with modern rich text editors or is it still unplanned? We've got customers and prospects looking for such feature from time to time and we're completely blocked as this is something that we cannot fix on our end. |
Hi @wwalc, thanks for your interest. We're currently working on RTE support. We have already released support for Draft, Quill, Prosemirror on limited set of sites. The general release is under way, but I can't give an ETA right now. We will be looking into supporting CKE as well. |
@blacktaxi that sounds promising, thank you for the update. If you need any help from our side, please feel free to ping us. |
Just adding to this issue that Grammarly seems to work both on our implementation of CKEditor and on the CKEditor demo page. We've noticed some strange behavior in Firefox, but can't consistently reproduce, so that may be an unrelated issue. One "gotcha" we ran into is that Grammarly requires the height of your editable element to be at least 38px (https://support.grammarly.com/hc/en-us/articles/115000091592-How-does-Grammarly-s-browser-extension-work-), but once we fixed that everything seems to work 👍🏻 |
Indeed, I can confirm that sometimes Grammarly in Firefox might behave unstable, especially as it comes to nested editables like table cells, image captions. @blacktaxi, if there's something we can do to help you with improving the behaviour in Firefox, don't hesitate to ping us, we'll be happy to help. |
How was this eventually handled? Did you make changes so that Grammarly has a way to modify the content? |
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may be relevant, so if you're interested in the solution, leave a comment or reaction under this issue. |
We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it). |
Current status - 17.05.2021
Grammarly is compatible with CKEditor 5 and provides a good editing experience in the Chrome browser.
Known issues: It's possible to experience some unstable behaviour while using the extension in Firefox.
I've recently installed Grammarly to check how it behaves on the CKEditor 5 demo.
Grammarly works with contenteditable enabled elements. I assume that it makes modifications to the DOM directly as corrections are made. In CKEditor 5, any correction you try to do with it is ignored.
To try it:
Lets go!
at the end of the paragraph.Expected:
Lets
but the underline highlight is not displayed.The text was updated successfully, but these errors were encountered: