I keep a TiddlyWiki for documenting bits of code, scripts etc. In TWC, I 
had a homegrown plugin that added a “Copy All to Clipboard” button to every 
code block. (Eventually, it degraded to “Select All”, when manipulating the 
clipboard from a web page became impossible, with tightened security in a 
newer version of Firefox.)

I was missing that functionality in TW5, but didn’t want to rewrite the 
plugin since I would not be able to make it copy to clipboard anyways. 
Finally, it occured to me that there might be a browser add-on that could 
do the same. All that is required is copy inner HTML from an element on a 
right click. It wasn’t easy to find, but there it is: 
https://addons.mozilla.org/en-US/firefox/addon/texttotag/

After installing it, right click on your piece of code, select “TextToTag” 
from the menu and voila - the code is in your clipboard.

When clicking, make sure you are pointing to the text, and not to the 
whitespace between the lines or on the right-hand side in a block of code. 
And if you find that limitation inconvenient, you can click anywhere within 
the block of code if you add this to your stylesheet:

pre code, pre.hljs code { display: table; }

Enjoy!

—R
​

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/54af78c1-fac2-4c92-b2d9-c9b2acb87651%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to