Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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 pondering the Monastery: (10)
As of 2015-07-28 11:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls