While working on a Form-Builder for Helpmonks, so our users can just copy & paste the HTML into their pages, I’ve re-used Codemirror.
I’m not the biggest fan of the project, but once configured it mainly works well. However, they don’t seem to believe in adding features that someone would find to “make sense”. One of those is that they don’t provide a copy function.
Hence, this small snippet, which I’ve figured out