Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Copy With Syntax Highlighting not work with Keynote/Pages #21686
Steps to Reproduce:
Expect Result: Paste code block with style to Keynote
Actual Result: Paste plain text to Keynote
If I paste to MS Word first, copy from Word. Then paste to Keynote.
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
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 @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.
referenced this issue
Sep 18, 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.
Thanks for your understanding and happy coding!