Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8817f25b

Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt

  • ID 8817f25b3b69622f98edfc74393ae8d88f827b7a
  • Vorgänger 0cdbf7b0
  • Nachfolger 7af2b128

Presenter: escape_js() zum Escapen von JavaScript

Unterschiede anzeigen:

SL/Presenter.pm
return SL::Presenter::EscapedText->new(text => $text, is_escaped => 1);
}
sub escape_js {
my ($self, $text) = @_;
$text =~ s|\\|\\\\|g;
$text =~ s|\"|\\\"|g;
$text =~ s|\n|\\n|g;
return SL::Presenter::EscapedText->new(text => $text, is_escaped => 1);
}
1;
__END__
......
L<SL::Presenter::EscapedText>. This is a no-op (the same instance will
be returned).
=item C<escape_js $text>
Returns a JavaScript-escaped version of C<$text>. Instead of a string
an instance of the thin proxy-object L<SL::Presenter::EscapedText> is
returned.
It is safe to call C<escape> on an instance of
L<SL::Presenter::EscapedText>. This is a no-op (the same instance will
be returned).
=item C<get_template>
Returns the global instance of L<Template> and creates it if it

Auch abrufbar als: Unified diff