ProKeys
ProKeys copied to clipboard
Doesn't give line-break or space
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.
- Creating new snippet
- Using that snippet in LinkedIn message window.
- Originally, it copy pastes text with what we specified in our plugin.
- 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)
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!
Analysis of CE structuring all most popular websites/editors:
-
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>
-
Gmail, Outlook, Evernote
<div>one line</div> <div>second line</div> <div><br></div> <!-- blank line --> <div>fourth line</div>
-
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>
- 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 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.