| HTML-Widget documentation | Contained in the HTML-Widget distribution. |
HTML::Widget::Filter::HTMLEscape - HTML Escaping Filter
my $f = $widget->filter( 'HTMLEscape', 'foo' );
HTML Escaping Filter.
HTML::Element now checks for, and refuses to escape already-escaped characters. This means that if you wish to double-escape characters, you must now do it yourself.
Lyo Kato, lyo.kato@gmail.com
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| HTML-Widget documentation | Contained in the HTML-Widget distribution. |
package HTML::Widget::Filter::HTMLEscape; use warnings; use strict; use base 'HTML::Widget::Filter';
sub filter { my ( $self, $value ) = @_; return unless defined $value; $value =~ s/&(?!(amp|lt|gt|quot);)/&/g; $value =~ s/</</g; $value =~ s/>/>/g; $value =~ s/\"/"/g; return $value; }
1;