feart: Enhances clipboard copying with MIME type selection#17
feart: Enhances clipboard copying with MIME type selection#17twofingerrightclick wants to merge 2 commits into
Conversation
e300bce to
57bcd75
Compare
|
@danburzo This tool was a top hit on google or "What is on my clipboard"! I was about to build something like it because I needed to get html as plain text. Then I needed to get the plain text as html, so I added that in a way that I thought seemed reasonable enough. I often need to copy plain text as svg as well so added that and a few others for experimentation. Thanks for building this! |
Introduces a new component to allow copying text content to the clipboard with various MIME types (e.g., plain text, HTML, Markdown). Utilizes the `ClipboardItem` API for rich data transfers, falling back to `writeText` for basic plain text copy if advanced features are unavailable. The UI now includes a dropdown for MIME type selection. Updates class attributes to className for React consistency.
57bcd75 to
8743f66
Compare
|
Thanks for this, @twofingerrightclick, it’s a great addition! I haven’t experimented lately with writing custom MIME types to the clipboard, but IIRC there are some things that complicate this: https://developer.chrome.com/blog/web-custom-formats-for-the-async-clipboard-api/ It warrants some testing around:
|
|
@danburzo Thanks for pointing this out — I hadn’t fully realized at first that clipboard support is intentionally limited for certain MIME types, both for security reasons and because browser support is still inconsistent. I should have tested more. The only formats that currently work reliably with the new copy button are plain text and HTML. Interestingly, when copying HTML, the I’ve adjusted it so the dropdown now only includes the two supported/reliable options. |
Introduces a new component to allow copying text content to the clipboard with various MIME types (e.g., plain text, HTML, Markdown). Useful when you want to copy a type as another type. Defaults to
plain/text.Utilizes the
ClipboardItemAPI for rich data transfers, falling back towriteTextfor basic plain text copy if advanced features are unavailable. The UI now includes a dropdown for MIME type selection.Updates class attributes to className for React consistency.