perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gerald Richter" <rich...@ecos.de>
Subject RE: Does escmode param work in 1.3.3 HTML::Embperl::Execute ?
Date Wed, 12 Jan 2005 21:14:31 GMT
> sub UserText($) {
>     my($t) = @_;
>     my($r);
>     HTML::Embperl::Execute({'escmode' => 1, 
>                             'input' => \$t, 
>                             'inputfile' => 
> 'usersuppliedtext',         
>                             'output' => \$r});
>     $r =~ s/\x0d\x0a/<BR>\n/g;
>     $r =~ s@^(>.*)$@<I>$1</I>@gm;
>     $r =~ s@((?:ftp|http|news)://[^ <]*[^ .,:;!?<>()])@<A 
> HREF="$1">$1</A>@gi;
>     return $r;
> }
> ...
> 
> But beside the 'escmode' => 1 parameter, 
> HTML::Embperl::Execute doesn't seem to HTML-escape <, >, etc.
> 
> 

Escmode => 1 does not escape the source text, but it escape only the output
done by Perl code.

To escape your text use

[-
# at the top of your file
$epreq = shift ;
-]

....

Then you can use

$r = $epreq -> Escape($t, 1) ;

Gerald


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message