X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=scripts%2Fimage_maps.pl;h=f025340ab32b4ee39335234085313a85bf5b6d20;hb=cd3150ed14f13bc1af071dd0f91015dd32360eae;hp=e6a47d95dabb32b9ea4135f6b49d5f3a2152b8d5;hpb=075bd42af8885aee3c18fe055a2c82b8b43f4cea;p=kivitendo-erp.git diff --git a/scripts/image_maps.pl b/scripts/image_maps.pl index e6a47d95d..f025340ab 100755 --- a/scripts/image_maps.pl +++ b/scripts/image_maps.pl @@ -81,7 +81,12 @@ for (@gd_images) { for (@gd_images) { my $name = fileparse($_->{filename}, ".png"); - $name =~ s/ /-/g; + + # the full grammar for valid css class names is completely bonkers (to put it mildly). + # so instead of trying to punch filenames into those class names, we'll + # just reduce them to a nice minimal set of lower case /[a-z0-9_-]*/ + $name = lc $name; + $name =~ s/[^a-z0-9_-]/-/g; print $file ".$class_for_map.$name { background-position: -$_->{h_offset}px 0px; }\n"; } }