Revision 8817f25b
Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt
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
Presenter: escape_js() zum Escapen von JavaScript