typst / webapp-issues

Issue tracker for Typst's web app.
https://typst.app
12 stars 0 forks source link

Clipboard paste prefers images over text #308

Open LONGACAT opened 6 months ago

LONGACAT commented 6 months ago

Description

When copying a cell from LibreOffice Calc and pasting into Typst, the cell gets pasted as an image instead of text as one would expect.

Steps to reproduce:

  1. Open LibreOffice Calc
  2. Write anything in any cell
  3. Copy the cell
  4. Paste it to Typst

Expected result: Cell contents get pasted as text

Actual result: #image("image.png") showing a screenshot of the cell gets inserted.

It turns out LibreOffice copies the cell in a couple of different formats, PNG and plaintext among them. When looking at my clipboard contents in NirSoft's InsideClipboard I got these results:

image

As you can see, both CF_TEXT and PNG appear.

I have also checked out my clipboard contents on the online Clipboard Inspector to see if the plaintext is even exported to the browser when it accepts an image, it is so it should be possible to use it in the web app explicitly instead of defaulting to images (for example, GitHub defaults to text/html and Discord also defaults to an image in this case):

image

Reproduction URL

No response

Browsers

Firefox

OS

Windows, Linux