Function: copyRichText()
ts
function copyRichText(html, fallbackText): Promise<boolean>;Copies rich HTML content to the clipboard, with a plain-text fallback.
Parameters
| Parameter | Type | Description |
|---|---|---|
html | string | The HTML string to write to the clipboard. |
fallbackText | string | Plain-text fallback used when the Clipboard API is unavailable. |
Returns
Promise<boolean>
true when the copy succeeded.
Example
ts
console.log(await copyRichText('<b>Hello</b>', 'Hello'))Since
1.0.0