logseq / logseq

A privacy-first, open-source platform for knowledge management and collaboration. Download link: http://github.com/logseq/logseq/releases. roadmap: http://trello.com/b/8txSM12G/roadmap
https://logseq.com
GNU Affero General Public License v3.0
33.3k stars 1.95k forks source link

Cannot paste from LibreOffice Calc spreadsheet #10194

Open loziniak opened 1 year ago

loziniak commented 1 year ago

(edit) In version 0.10.7it is not possible to paste from spreadsheet at all.

Search first

What Happened?

I wanted to import a snippet of a LibreOffice spreadsheet. Used CTRL-C in LibreOffice and CTRL-V in logseq block. Instead of a table, the content was rendered as an image.

Reproduce the Bug

  1. open a spreadsheet in LibreOffice
  2. select some cells and press CTRL-C
  3. in logseq create a new block and press CTRL-V

Expected Behavior

Data should be inserted in a textual form, or preferably a table.

Screenshots

obraz obraz

Desktop or Mobile Platform Information

Manjaro Linux, libreoffice-fresh 7.5.5-1, logseq-desktop-bin 0.9.17-1 Linux latitude5580 6.2.0-2-rt3-MANJARO #1 SMP PREEMPT_RT Sun Apr 16 02:12:15 UTC 2023 x86_64 GNU/Linux

Additional Context

I tested clipboard content types with xclip tool when copying from LibreOffice, and indeed it can serve data as image (image/png or image/bmp):

$ xclip -selection c -t TARGETS -o
TIMESTAMP
TARGETS
MULTIPLE
SAVE_TARGETS
application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source (XML)"
application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="47BBB4CB-CE4C-4E80-a591-42d9ae74950f";typename="LibreOffice 7.5 Arkusz kalkulacyjny";displayname="file:///home/maciek/prj/maidsafe/cryptography%2520usage%2520architectural%2520patterns.ods";viewaspect="1";width="17100";height="2084";posx="0";posy="0"
application/x-openoffice-gdimetafile;windows_formatname="GDIMetaFile"
application/x-openoffice-emf;windows_formatname="Image EMF"
application/x-openoffice-wmf;windows_formatname="Image WMF"
image/png
application/x-openoffice-bitmap;windows_formatname="Bitmap"
image/bmp
text/html
application/x-openoffice-sylk;windows_formatname="Sylk"
application/x-openoffice-link;windows_formatname="Link"
application/x-openoffice-dif;windows_formatname="DIF"
text/plain;charset=utf-16
application/x-libreoffice-tsvc
text/rtf
text/richtext
text/plain;charset=utf-8
UTF8_STRING
STRING
application/x-libreoffice-internal-id-118609

Probably logseq chooses first media type it can digest (image/png). Perhaps some formats could be preferred to the others by logseq, like text/html > text/plain;charset=utf-8 > image/jpeg > image/png?

I don't know which format is supported by logseq to create tables, but suppose text/html. Clipboard output for HTML looks like this:

$ xclip -selection c -t text/html -o 
<!DOCTYPE html>

<html>
<head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title></title>
    <meta name="generator" content="LibreOffice 7.5.5.2 (Linux)"/>
    <style type="text/css">
        body,div,table,thead,tbody,tfoot,tr,th,td,p { font-family:"Liberation Sans"; font-size:x-small }
        a.comment-indicator:hover + comment { background:#ffd; position:absolute; display:block; border:1px solid black; padding:0.5em;  } 
        a.comment-indicator { background:red; display:inline-block; border:1px solid black; width:0.5em; height:0.5em;  } 
        comment { display:none;  } 
    </style>

</head>

<body>
<table cellspacing="0" border="0">
    <colgroup width="283"></colgroup>
    <colgroup width="363"></colgroup>
    <tr>
        <td height="62" align="left" valign=top><font face="Liberation Serif">Certificate Authority Trust PatternThis pattern involves using a trusted third party (the certificate authority) to verify the identity of entities and issue them digital certificates.</font></td>
        <td align="left" valign=top><font face="Liberation Serif">Certificate Authority Trust Pattern</font></td>
    </tr>
    <tr>
        <td height="17" align="left" valign=top><font face="Liberation Serif"><br></font></td>
        <td align="left" valign=top><br></td>
    </tr>
    <tr>
        <td height="77" align="left" valign=top><font face="Liberation Serif">Zero-Knowledge Proof PatternThis pattern involves proving that one knows a value x, without conveying any information apart from the fact that one knows the value x. It's used in authentication systems and blockchain technology.</font></td>
        <td align="left" valign=top><font face="Liberation Serif">Zero-Knowledge Proof Pattern</font></td>
    </tr>
</table>
</body>

</html>

Are you willing to submit a PR? If you know how to fix the bug.

github-actions[bot] commented 8 months ago

Hi There! 👋

We haven't seen any activity on this issue in a while :sleeping:, and we just wanted to make sure that it's still relevant. If you're still experiencing this issue, you might find it helpful to update to the latest version of Logseq. The latest version includes bug fixes and new features that may help to resolve this issue, and you can download it from our website. If updating to the latest version doesn't help, please let us know by adding a comment 💬. We're here to help!

If the issue has been resolved or is no longer relevant, that's great news! 🎉 We'll go ahead and close this issue to keep our backlog organized. Please note that this issue will be closed automatically in 20 days if there is no further activity. If you need more time to resolve the issue or provide more information, please just let us know by adding a comment.

Access additional Logseq 🚀 resources:

Thanks for your contributions to Logseq! If you have any other issues or feature requests, please don't hesitate to let us know. We always welcome pull requests too!

loziniak commented 8 months ago

Now (v0.10.7) I'm unable to paste from LibreOffice Calc at all.