Skip to content

Instantly share code, notes, and snippets.

@robin-a-meade
Last active March 11, 2023 21:36
Show Gist options
  • Save robin-a-meade/62a53fcad4703fd91504d1f9d170a011 to your computer and use it in GitHub Desktop.
Save robin-a-meade/62a53fcad4703fd91504d1f9d170a011 to your computer and use it in GitHub Desktop.
Test case for pasting into GDoc

GDoc bug?

I've found that pasting into a Google Document produces an unexpected result.

Minimal test case

Copy the following minimal test case:

A link

and paste it into a GDoc.

Result

When pasted into a GDoc, the text of the link includes the preceding space.

Paste result

Notes

After copying the minimal test case to the clipboard, the clipboard contains the following:

❯ xclip -sel c -t text/html -o
<meta http-equiv="content-type" content="text/html; charset=utf-8">A <a href="https://example.com" rel="nofollow">link</a>

As you can see, the link text on the clipboard correctly consists only of the word link; is does not include a space. But when pasted into a GDoc, the text of the link includes the preceding space.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment