- if (# strip out the w3c img callback; replace with alt text
- $fc =~ s{<img\s+src="http://www.w3c.org/Icons/[^"]+"[^>]*?alt="([^"]+)"[^>]*>}{$1}img
- or
- # if it doesn't have alt text, just replace it with Valid HTML
- $fc =~ s{<img\s+src="http://www.w3c.org/Icons/[^"]+"[^>]*>}{Valid HTML}img ) {
+ # strip out the w3c img callback; replace with alt text
+ my $changed = $fc =~ s{<img\s+src="http://www.w3c?.org/Icons/[^"]+"[^>]*?alt="([^"]+)"[^>]*>}{$1}imsg;
+ # if it doesn't have alt text, just replace it with Valid HTML
+ $changed += $fc =~ s{<img\s+src="http://www.w3c?.org/Icons/[^"]+"[^>]*>}{Valid HTML}imsg;
+
+ if ($changed) {