copy-rich-text

copy text or rich text to clipboard

Usage no npm install needed!

<script type="module">
  import copyRichText from 'https://cdn.skypack.dev/copy-rich-text';
</script>

README

copy-async

复制文本、富文本到剪切板,WebSite

usage

npm i copy-rich-text
import copy from 'copy-rich-text';

await copy('hello world');
await copy('<h1>hello world</h1>');
await copy(document.querySelector('#rich-text'));
await copy(document.querySelector('#rich-text'), { html: true });