ProKeys icon indicating copy to clipboard operation
ProKeys copied to clipboard

Doesn't give line-break or space

Open UnnitMetaliya opened this issue 5 years ago • 3 comments

Hi user! Please use this template to easily file your issue:

Data

Browser name: -Google Chrome OS name: - Windows 10 Site where ProKeys is functioning improperly - LinkedIn, Gmail

Description:

Steps to reproduce issue Doing the following in latest ProKeys version will cause the problem I'm writing about.

  1. Creating new snippet
  2. Using that snippet in LinkedIn message window.
  3. Originally, it copy pastes text with what we specified in our plugin.
  4. Upon, sending message, it ruins the formatting. There are no spaces or line-breaks.

Actual behavior The above steps result in: sending text in snippet without line-breaks or spaces.

Expected behavior The following was supposed to happen/should have happened: send the text with format specified in snippet. Means with line-breaks and spaces.


  • [ TRUE] - I have confirmed the issue occurs even after reinstall (and data backup) of ProKeys
    (ignore if not applicable)

UnnitMetaliya avatar Jun 28 '19 00:06 UnnitMetaliya

Hi, thanks for the report! I can confirm the issue in LinkedIn messaging, it strips away the newlines.

However, I cannot confirm on Gmail. I sent a test email to myself and it did not strip any newlines.

The issue fix is more complicated than just inserting multiple span elements, as #259, I hope to release an update within the next month to tackle this issue. Thanks for your patience!

GaurangTandon avatar Jun 28 '19 02:06 GaurangTandon

Analysis of CE structuring all most popular websites/editors:

  1. LinkedIn messaging, Slack, TinyMCE (all three variants), CK editor

    <p>one line</p>
    <p>second line</p>
    <p><br></p> <!-- blank line -->
    <p>fourth line</p>
    
  2. Gmail, Outlook, Evernote

    <div>one line</div>
    <div>second line</div>
    <div><br></div> <!-- blank line -->
    <div>fourth line</div>
    
  3. Disqus

This guy happens to have contenteditable="PLAINTEXT-ONLY" (which results in prokeys not working there) but also resulting in this structure

<p> <!-- text nodes! -->
"line one"
"line two"
""
"line four"
</p>
  1. WhatsApp follows a similar approach to Disqus, except that their div is labelled contenteditable=true. Honestly this is just too much -_-

Current probably approach: insert first line of text in closest current parent p/div element, then insert remaining lines in new paragraph/div nodes, integrating the last insertion with the next paragraph/div node.

Note: most of salesforce, discord, discourse uses a textbox so they are non-issue here.

GaurangTandon avatar Jul 02 '19 07:07 GaurangTandon

@GaurangTandon This approach didn't solve my issue. Same thing happens after hitting send. On message window, it appears with whatever formatting we specify. The problem occurs after hitting send.

UnnitMetaliya avatar Jul 04 '19 22:07 UnnitMetaliya