Skip to content
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

Recognize Markdown when pasting a table from Google Sheets #29833

Open
Tracked by #32400
zdenys opened this issue Mar 12, 2021 · 2 comments
Open
Tracked by #32400

Recognize Markdown when pasting a table from Google Sheets #29833

zdenys opened this issue Mar 12, 2021 · 2 comments
Labels
[Block] Table Affects the Table Block [Feature] Paste [Type] Enhancement A suggestion for improvement.

Comments

@zdenys
Copy link

zdenys commented Mar 12, 2021

What problem does this address?

When copying a table from Google Sheets and pasting it in the Editor, it automatically converts the content into a Table block (which is cool!). However, if the original table contains a Markdown-formatted link, it is not recognized and pasted as text, whereas the hyperlinks from the original table are recognized fine.

What is your proposed solution?

Recognize the Markdown-formatted links and paste them as such, just like the hyperlinks. Ideally, full Markdown support would be helpful as Markdown-formatted links are just one example.

Screenshots

The original table in Google Sheets:


Link: https://d.pr/i/qBAyuE

The result after copying it and pasting it in the editor:


Link: https://d.pr/i/8Tx8U7

Code of the page after pasting:

<!-- wp:table -->
<figure class="wp-block-table"><table><tbody><tr><td>Colum 1</td><td>Column 2</td></tr><tr><td>Text</td><td>Text</td></tr><tr><td>[Markdown link](https://wordpress.org)</td><td><a href="https://wordpress.org/" target="_blank" rel="noreferrer noopener">Hyperlink</a></td></tr></tbody></table></figure>
<!-- /wp:table -->
@talldan talldan added [Feature] Paste [Type] Enhancement A suggestion for improvement. [Block] Table Affects the Table Block labels Mar 15, 2021
@talldan
Copy link
Contributor

talldan commented Mar 15, 2021

I also noticed pasting a mardown link on its own into a paragraph results in a code block being created:

[Markdown link](https://wordpress.org)

while with some text, a paragraph with a link is created:

Test [Markdown link](https://wordpress.org) test

Not sure if the two issues could be related.

@zdenys
Copy link
Author

zdenys commented Mar 16, 2021

On a related note, if I paste the same table from Google Sheets (as in my original comment above) into the Editor but without formatting (so for example by using CMD + SHIFT + V on macOS) what I get is this:


Link: https://d.pr/i/xjY7eI

<!-- wp:paragraph -->
<p>Column 1 Column 2<br>Text Text<br><a href="https://wordpress.org">Markdown link</a> Hyperlink</p>
<!-- /wp:paragraph -->

So this time the Markdown-formatted link is recognized, but the hyperlink is not, and also no Table Block is created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block [Feature] Paste [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants