highlight-loader
highlight-loader copied to clipboard
Adding "Copy to Clipboard"
I would like to add a copy to clipboard option to the code section. I wonder how I can do it.
One option is to add the button using css :after and then listen to click events. However I still need to be able to get raw content from somewhere. Is it possible to add it as, for example, data-raw attribute to the code element?
I solved this by adding $e.parent().attr('data-raw-code', text); to replaceWith() callback.
Cool. You could perhaps PR that as a doc improvement.