It takes too long to recolor individual tokens for a sample code snippet in a Keynote presentation. Why not let a computer do the work for me so I can just copy/paste the result!
TLDR:
- ✅ Safari to Keynote
- ❌ Chrome/Firefox/Edge to Keynote
- ✅ Chrome/Firefox/Edge to TextEdit to Keynote
Copying rich text from the web into Keynote is not as straightforward as it should be. This works if you're using Safari. But for the other browsers, Keynote strips off the formatting. You need to paste to an intermediate app that supports rich text formatting (e.g. TextEdit, Word, etc.), then copy that text and paste into Keynote.