- From: Ana Sollano Kim <notifications@github.com>
- Date: Wed, 29 Mar 2023 13:42:17 -0700
- To: w3c/editing <editing@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Wednesday, 29 March 2023 20:42:30 UTC
@anaskim commented on this pull request.
> +const blobInput = new Blob([textInput], { type: 'text/html' });
+const clipboardItem = new ClipboardItem({ 'text/html': blobInput });
+await navigator.clipboard.write([clipboardItem]);
+```
+
+Writing unsanitized HTML to the clipboard:
+```html
+<style>p { color: blue; }</style><p>Hello, World!</p>
+```
+
+For reference, this would be the sanitized output:
+```html
+<p style="color: blue; font-size: medium; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">Hello, World!</p>
+```
+
+The read method now accepts a dictionary with the `unsanitized` keyword and the `text/html` MIME type.
Done.
--
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/pull/422#discussion_r1152463298
You are receiving this because you are subscribed to this thread.
Message ID: <w3c/editing/pull/422/review/1363926974@github.com>
Received on Wednesday, 29 March 2023 20:42:30 UTC