You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Copy With Syntax Highlighting not work with Keynote/Pages #21686
*out-of-scopePosted issue is not in scope of VS Codeeditor-clipboardEditor clipboard issueshelp wantedIssues identified as good community contribution opportunities
For short, we can't do this with current design at this moment.
The long reason is that all our copy and paste stuff (and type, screen reader, etc) relies on HTML Dom. We listen to Copy/Paste events on textarea and we access the clipboard through the events. It's the browser (Chromium in our case) who handles all the clipboard work for us. If Chromium doesn't set HTML content in the system clipboard reasonably, then we can't.
As Matt Bierner (@mjbvz) mentioned above, Word may set RTF text to system clipboard through some native API. If we want to do the same thing, we may need some nodejs power to access clipboard.
This iteration we focus on issue grooming. This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
You can try to copy code block as html format onto Apple's TextEdit.app then re-copy to keynote. The TextEdit.app will translate into RTF format for you. Hope this help. reference
*out-of-scopePosted issue is not in scope of VS Codeeditor-clipboardEditor clipboard issueshelp wantedIssues identified as good community contribution opportunities
Activity
mjbvz commentedon Mar 2, 2017
I confirmed this
Pages and keynote may not support pasting html content http://apple.stackexchange.com/questions/124152/how-do-you-paste-syntax-highlighted-code-into-keynote-13 . I suspect that copying code from Word works because Word copies RTF text to the clipboard in addition to html content. It seems to me that this RTF text is what Pages and Keynote are looking for
rebornix commentedon Mar 13, 2017
For short, we can't do this with current design at this moment.
The long reason is that all our copy and paste stuff (and type, screen reader, etc) relies on HTML Dom. We listen to Copy/Paste events on textarea and we access the clipboard through the events. It's the browser (Chromium in our case) who handles all the clipboard work for us. If Chromium doesn't set HTML content in the system clipboard reasonably, then we can't.
As Matt Bierner (@mjbvz) mentioned above, Word may set RTF text to system clipboard through some native API. If we want to do the same thing, we may need some nodejs power to access clipboard.
nitish24p commentedon Feb 28, 2018
Anyone found a work around this? still seem to be facing this issue
vscodebot commentedon Sep 20, 2018
This iteration we focus on issue grooming. This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.
If you wonder what we are up to, please see our roadmap and issue reporting guidelines.
Thanks for your understanding and happy coding!
ch-hans-chen commentedon Sep 28, 2018
You can try to copy code block as html format onto Apple's TextEdit.app then re-copy to keynote. The TextEdit.app will translate into RTF format for you. Hope this help. reference
nitish24p commentedon Sep 29, 2018
Yes i did that back then and it worked