Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Clipboard transform key: Text to HTML for PerlMonks

by PhilHibbs (Hermit)
on Aug 19, 2003 at 18:08 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-18 19:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found