RMedia
% if ($copy){
% }
<%args>
$text => undef
$copy => undef
$clearn => undef
%args>
<%init>
my $arg_code = $text;
my $code = $text;
my $param_clearn = $clearn;
my $textarea_code = $code;
my $checked_copy = $copy ? 'checked' : '';
my $checked_clearn = $param_clearn? 'checked' : '';
%init>
<%perl>
my $initial = $code;
$textarea_code =~ s/&/&/g;
$textarea_code =~ s/</g;
$textarea_code =~ s/>/>/g;
$code =~ s/\@{3}/ /g;
$code =~ s/\xB9/N/g;
$code =~ s/№/N/g;
$code =~ s/\xAE/(r)/g;
$code =~ s/®/(r)/g;
$code =~ s/®/(r)/g;
$code =~ s/\xA9/(c)/g;
$code =~ s/©/(c)/g;
$code =~ s/©/(c)/g;
$code =~ s/\x96/-/g;
$code =~ s//-/g;
$code =~ s/\x97/-/g;
$code =~ s//-/g;
$code =~ s/(«|»|\xAB|\xBB|\x93|\x94)/"/gi;
$code =~ s/\xB6//g;
$code =~ s/\x85/.../g;
$code =~ s/
/.../g;
$code =~ s/…/.../g;
$code =~ s/…/.../g;
$code =~ s/
]*?>//gi;
$code =~ s/<\/p>/\r\n\r\n/gi;
$code =~ s/
/\r\n\r\n/gi;
$code =~ s/\t+/ /g;
if (!$param_clearn){$code =~ s/\r\n/\r\n\r\n/g;}
$code =~ s/\r\n *\r\n/\r\n\r\n/g;
$code =~ s/([^\.\;\:\?\!])\r\n/$1 /g;
$code =~ s/(\r\n){2,}/\r\n/g;
$code =~ s/ +/ /g;
$code =~ s/ \r\n/\r\n/g;
$code =~ s/\r\n /\r\n/g;
$code =~ s/ $//g;
$code =~ s/^/
/;
$code =~ s/\r\n/<\/p>\r\n
/g;
$code =~ s/$/<\/p>/;
$code =~ s/
<\/p>\r\n//gi;
$code =~ s/
<\/p>//gi;
$code =~ s/\(c\)/©/gi;
if ($code){
print 'Результат (plain text):';
print ''.$code;
}
%perl>