Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Clipboard transform key: Text to HTML for PerlMonks

by PhilHibbs (Hermit)
on Aug 19, 2003 at 18:08 UTC ( #284974=note: print w/ replies, xml ) Need Help??


in reply to Clipboard transform keys

Here is another clipboard transform that I use. It translates plain text to HTML markup for special characters, and is enhanced for PerlMonks with [ and ] handling (there, I just used it). I call it "clipmonk.cmd", and I bind it to Ctrl-Shift-M.
Update: Added L~R, ()}{ and s_t translation

@rem = '--*-Perl-*-- @echo off perl -x -S "%~dpnx0" %1 %2 %3 %4 %5 %6 %7 %8 %9 goto endofperl @rem '; #!perl #line 8 use strict; use warnings; use HTML::Entities; use Win32::Clipboard; my $CLIP = Win32::Clipboard(); my $text = $CLIP->GetText; $text = encode_entities($text); $text =~ s|\[|\[|g; $text =~ s|\]|\]|g; $text =~ s/L~R/[Limbic~Region|L~R]/g; $text =~ s/\(\)}{/[(-+-)bsidian }{eat|()}{]/g; $text =~ s/s_t/[submersible_toaster|s_t]/g; $CLIP->Set($text); __END__ :endofperl


Comment on Clipboard transform key: Text to HTML for PerlMonks
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://284974]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-10-20 05:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (72 votes), past polls