projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Term::ReadLine::Perl::Bind in Console nicht nutzen
[kivitendo-erp.git]
/
SL
/
HTML
/
Util.pm
diff --git
a/SL/HTML/Util.pm
b/SL/HTML/Util.pm
index
7212d64
..
72a7a7f
100644
(file)
--- a/
SL/HTML/Util.pm
+++ b/
SL/HTML/Util.pm
@@
-6,6
+6,11
@@
use warnings;
use HTML::Parser;
my %stripper;
use HTML::Parser;
my %stripper;
+my %entities = (
+ 'lt' => '<',
+ 'gt' => '>',
+ 'amp' => '&',
+);
sub strip {
my ($class_or_value) = @_;
sub strip {
my ($class_or_value) = @_;
@@
-22,6
+27,8
@@
sub strip {
$stripper{parser}->parse($value);
$stripper{parser}->eof;
$stripper{parser}->parse($value);
$stripper{parser}->eof;
+ $stripper{text} =~ s{\&([^;]+);}{ $entities{$1} || "\&$1;" }eg;
+
return delete $stripper{text};
}
return delete $stripper{text};
}