aecreations / clippings

Clippings: an extension for Mozilla Firefox
20 stars 4 forks source link

'@' pasted instead of new lines in Zendesk #379

Open FirekGOG opened 2 years ago

FirekGOG commented 2 years ago

Tinkering with Clippings options doesn't help, unfortunately. :(

FirekGOG commented 2 years ago

Related: Zendesk claims they updated their editor to one powered by a "CKEDitor": https://support.zendesk.com/hc/en-us/articles/4410679020826-Announcing-composer-migration-for-the-Zendesk-standard-agent-interface https://ckeditor.com/

aecreations commented 2 years ago

It appears that CKEditor, the HTML editor that the Zendesk composer recently changed to, is stripping away the line breaks inserted by Clippings. When Clippings inserts text into an HTML editor, it replaces line breaks with the HTML <br> tag, which CKEditor is replacing with the @ symbol.

CKEditor is also causing problems with any clippings that are formatted with HTML (e.g. <b>, <strong>, <i>,<span style="...">, etc.). If a clipping contains HTML formatting, CKEditor won't paste it at all.

This issue doesn't happen with other HTML editors such as TinyMCE[1], or that found in Gmail, Outlook.com or Yahoo! Mail.

I tried out the demo CKEditor[2] and discovered that if I switch to HTML source view and paste the clipping into the HTML source editor, the HTML formatting will be inserted correctly. However, I would still have to put <br> tags where I want the line breaks to occur.

@FirekGOG Can you confirm if Zendesk has an option in the composer to switch to HTML source view, and if so, confirm if the above workaround works? I don't have access to Zendesk, so I'm unable to verify.

-- [1] https://www.tiny.cloud/docs/demo/pageembed/ [2] https://ckeditor.com/docs/ckeditor5/latest/examples/builds-custom/full-featured-editor.html

FirekGOG commented 2 years ago

I just asked their support, and will let you know, but judging by their previous answer ("ask the developer") I doubt the answer will be anything other than "nope"... :( Is there anything you could do to adapt the plugin on your end?

FirekGOG commented 2 years ago

And thanks a LOT for responding! <3

FirekGOG commented 2 years ago

As expected, "nope" it is. :( The only option available is to switch to from the WYSIWYG editor to the ancient markdown-based one, which is a "suboptimal" option for us to say the least. :(

aecreations commented 2 years ago

I've opened an issue in the CKEditor repository in GitHub (see preceding mention), as this issue impacts any web app that is using CKEditor, not just Zendesk.

aecreations commented 2 years ago

Clippings help page describing this issue: https://aecreations.sourceforge.io/clippings/ckeditor.php AE Creations blog post: https://aecreations.blogspot.com/2022/04/using-clippings-with-zendesk-and-other.html

FirekGOG commented 2 years ago

Thanks a lot for your efforts. :) For what it's worth, we're using a different ghetto workaround - out Support folk are using Clippings in another text window (we use the Knowledge Capture plugin for this in Zendesk's sidebar) and then cut-pasting the text where it's needed. :)

FirekGOG commented 2 years ago

Any news? :)

cadeyrn commented 11 months ago

@aecreations Witoso from CKSource wrote on their issue:

execCommand is not recommended, citing MDN:

Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. [bolded by me].

I would recommend trying to use Clipboard API in this case, and dispatch a paste event for example.

Does this help?

aecreations commented 11 months ago

See https://github.com/aecreations/clippings/issues/433#issuecomment-1833983776