[Bps-public-commit] r11932 - in HTML-RewriteResources: .
sartak at bestpractical.com
sartak at bestpractical.com
Mon Apr 28 20:22:25 EDT 2008
Author: sartak
Date: Mon Apr 28 20:22:24 2008
New Revision: 11932
Added:
HTML-RewriteResources/lib/HTML/RewriteResources.pm
Modified:
HTML-RewriteResources/ (props changed)
Log:
r54606 at onn: sartak | 2008-04-28 20:22:13 -0400
Subclass RewriteAttributes for RewriteResources
Added: HTML-RewriteResources/lib/HTML/RewriteResources.pm
==============================================================================
--- (empty file)
+++ HTML-RewriteResources/lib/HTML/RewriteResources.pm Mon Apr 28 20:22:24 2008
@@ -0,0 +1,27 @@
+#!/usr/bin/env perl
+package HTML::RewriteResources;
+use strict;
+use warnings;
+use base 'HTML::RewriteAttributes';
+
+my %rewritable_attrs = (
+ bgsound => { src => 1 },
+ body => { background => 1 },
+ img => { src => 1 },
+ input => { src => 1 },
+ table => { background => 1 },
+ td => { background => 1 },
+ th => { background => 1 },
+ tr => { background => 1 },
+);
+
+sub _should_rewrite {
+ my $self = shift;
+ my $tag = shift;
+ my $attr = shift;
+
+ return ( $rewritable_attrs{$tag} || {} )->{$attr};
+}
+
+1;
+
More information about the Bps-public-commit
mailing list