#31348·extensions

Clipboard.read() never returns `html` and Clipboard.copy({ html }) drops HTML on Windows

Author: cwouyangCreated Sep 21, 2026Updated Sep 28, 2026
Labelsstatus: fixed in next release

Description

On Windows, the Clipboard API ignores the HTML representation in both directions:

  • Clipboard.read() returns text but html is always undefined, even when the system clipboard holds an HTML Format (CF_HTML) entry.
  • Clipboard.copy({ text, html }) writes only the text. The resulting clipboard has no HTML Format entry, so other apps can only paste plain text.

The docs describe ReadContent.html and Content.html with no platform restriction, and the manifest now accepts "platforms": ["macOS", "Windows"]. I couldn't find a changelog entry or known issue that mentions this limitation.

Extensions that depend on rich text fail silently. Markdown Converter (extensions/markdown-converter), for example, shows a success HUD on every run but never receives HTML to convert, and its HTML output never reaches the clipboard.

I reproduced this with the latest Raycast for Windows and the latest API:

  • Windows 11 Pro 10.0.26200
  • Raycast for Windows 2.4.0.0 (MSIX)
  • @raycast/api 2.4.1. Also reproduced with 1.104.x. @raycast/api is external in the bundle (require("@raycast/api")), so this looks like an app-side implementation gap.
  • Source app: Chrome 153.0.8010.50

Steps To Reproduce

A. Read

  1. Create a no-view command:

    typescript
    import { Clipboard, showHUD } from "@raycast/api";
    
    export default async function Command() {
      const { text, html } = await Clipboard.read();
      await showHUD(`text=${text?.length ?? "none"} html=${html?.length ?? "none"}`);
    }
  2. In Chrome, select some formatted content on a web page (for example, part of https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax) and press Ctrl+C.

  3. Confirm that Windows has HTML on the clipboard. In Windows PowerShell 5.1, run: (Get-Clipboard -TextFormatType Html -Raw).Length → 1088616, starting with Version:0.9 StartHTML:... SourceURL:...

  4. Run the command.

B. Write

  1. Create a no-view command:

    typescript
    import { Clipboard, showHUD } from "@raycast/api";
    
    export default async function Command() {
      await Clipboard.copy({ text: "hello", html: "<b>hello</b>" });
      await showHUD("copied");
    }
  2. Run the command.

  3. In Windows PowerShell 5.1, run: (Get-Clipboard -TextFormatType Html -Raw).Length

Current Behaviour

  • Read: HUD shows text=22128 html=none. At the same moment, Get-Clipboard -TextFormatType Html returns 1,088,616 characters. Every run gave the same result.
  • The same happens when Raycast itself put the HTML there: after I restored a rich entry from Clipboard History (the clipboard then held HTML Format and application/raycast-clipboard-metadata), Clipboard.read() still returned no html.
  • Write: HUD shows copied. Get-Clipboard -Raw returns hello, but Get-Clipboard -TextFormatType Html returns length 0. In an earlier run with a larger payload, System.Windows.Forms.Clipboard.GetFormats() listed System.String, UnicodeText, Text, application/raycast-clipboard-metadata, Locale, OEMText. Raycast handles the write (its metadata format is present) but never adds HTML Format.
  • Neither call throws, so extensions can't detect the failure.

Expected Behaviour

As documented:

  • Clipboard.read() returns the clipboard HTML in html when an HTML Format entry is present. Ideally it returns the fragment or document with the CF_HTML header (Version:, StartHTML:, …) removed, which would match macOS public.html.
  • Clipboard.copy({ html }) writes a valid CF_HTML HTML Format entry next to the text, so rich text pastes correctly into other apps.

If HTML isn't supported on Windows yet, please document it in the Clipboard API reference so extensions can declare platforms accurately.

Additional context

The only way I found to work around this from an extension is to spawn powershell.exe and read HTML Format through System.Windows.Forms.Clipboard. That adds about 2 s per run. It also fails in PowerShell Constrained Language Mode, which is common on managed corporate machines: Add-Type is blocked with CannotDefineNewType. It can't stand in for a fix in Raycast.