From a819e461b9662c343135564791e8062692b93a2d Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Thu, 1 Sep 2011 12:02:04 +0200 Subject: [PATCH] use title= too --- misc/tools/weapon-profiler-analyzer.pl | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/misc/tools/weapon-profiler-analyzer.pl b/misc/tools/weapon-profiler-analyzer.pl index a6838e9c..3f3a4c7c 100755 --- a/misc/tools/weapon-profiler-analyzer.pl +++ b/misc/tools/weapon-profiler-analyzer.pl @@ -234,6 +234,20 @@ sub out_text($@) } } +sub html($) +{ + my ($s) = @_; + $s =~ s/[^-_A-Za-z0-9 ]/&#@{[ord $&]};/g; + return $s; +} + +sub nospace($) +{ + my ($s) = @_; + $s =~ s/ //g; + return $s; +} + sub out_html($@) { my ($event, @data) = @_; @@ -249,13 +263,13 @@ sub out_html($@) $map ||= 'any'; print "

For server $addr type $type map $map

\n"; print "\n"; - printf '', $stats->weaponid_to_model($_), $stats->weaponid_to_name($_) for @columns; + printf '', $stats->weaponid_to_model($_), html $stats->weaponid_to_name($_), html nospace $stats->weaponid_to_name($_) for @columns; print "\n"; } elsif($event eq 'startrow') { my ($row, $val) = @data; - printf '', $stats->weaponid_to_model($row), $stats->weaponid_to_name($row), defined $val ? sprintf("%8.5f", $val) : "N/A"; + printf '', $stats->weaponid_to_model($row), html $stats->weaponid_to_name($row), html nospace $stats->weaponid_to_name($row), defined $val ? sprintf("%8.5f", $val) : "N/A"; } elsif($event eq 'cell') { -- 2.39.2
WeaponRating%s%s
%s%s
%s%s