Closed jmgasper closed 3 years ago
Challenge https://www.topcoder.com/challenges/a06b9b28-4ff1-4079-8b4e-2f6983c11ff1 has been created for this ticket.This is an automated message for ghostar via Topcoder X
Challenge https://www.topcoder.com/challenges/a06b9b28-4ff1-4079-8b4e-2f6983c11ff1 has been assigned to obog.This is an automated message for ghostar via Topcoder X
@jmgasper Yes, it's possible with Clipboard API. Clipboard API provides the ability to respond to clipboard commands (cut, copy, and paste).
@atelomycterus - Ok, let's do it, thanks!
@jmgasper Implemented. Please apply PR-https://github.com/topcoder-platform/forums-topcoder-editor-plugin/pull/23/. Thanks!
The algorithm for determining when to format as a table is very simple. This is done to allow the user to paste text into the editor.
Step 1. Split data using special characters.
Using standard \r=CR, \n=LF and Unicode special characters:
u2028 = line separator
u2029 = paragraph separator
u0085 = next line.
Step 2. if count of rows >= 2 and each row has the same count of column, count of column > 1. Data should be formatted as a table.
Please clear browser cache before testig.
Excel
Before changes:
With the PR: Edit Mode:
View Mode:
Colons can be used to align columns.
| Tables | Are | Cool |
| ------------- |:-------------:| -----:|
| col 3 is | text aligned | $1600 |
| col 2 is | centered | $12 |
| col1 is | text | $1 |
Output:
We can also improve the formatting of the table. In view mode, data is displayed as html. CSS styles might be applied.
I've noticed a copy-paste image feature in EasyMDE. If user is allowed to upload a file then it generates an png image of a selected area/data.
Uploading a file is allowed:
Uploading a file isn't allowed:
Payment task has been updated: https://www.topcoder.com/challenges/a06b9b28-4ff1-4079-8b4e-2f6983c11ff1
Payments Complete
Winner: obog
Copilot: ghostar
Challenge a06b9b28-4ff1-4079-8b4e-2f6983c11ff1
has been paid and closed.This is an automated message for ghostar via Topcoder X
@atelomycterus I verified this after clearing browser cache, but I don't see the background colors and line formatting being copied from excel, and in Firefox even the table structure is not rendered.
https://user-images.githubusercontent.com/4592712/115639955-7bc37a00-a333-11eb-9f7a-72b1ddc67fed.mp4
@jmgasper Please apply PR- https://github.com/topcoder-platform/forums-topcoder-editor-plugin/pull/24. Thanks!
@sdgun Thanks for testing! Fixed the issue in Firefox. I've tested it with Opera/Chrome/Firefox. Let me know if you observe any issues.
I don't see the background colors and line formatting being copied from excel.
Not supported. When copying cells from Excel and other spreadsheet applications, this data is stored in your browser clipboard.
The destination (topcoder editor textarea ) is not capable of handling the xls format. So it's copied as plain text.
Pasting a table from Excel will keep the formatting in Word.
The official Markdown does not provide any special syntax for tables. We are using GFM Markdown (Github Flavored Markdown) . This table syntax is quite simple. No styles (background, border), etc.
| | | | | |
|---|---|---|---|---|
| | | | | |
Verified in Firefox/Chrome/Edge in Dev.
Verified in production.
@atelomycterus - I'm assuming this is something that will need investigation and may not be possible. Let me know if we need to adjust anything or bump the payment here, thanks!