| Henry Lyne ( @ 2009-07-09 18:21:00 |
[livejournal] r15456: LJSUP-4556: Strip margins and heights fr...
Committer: henrylyne
LJSUP-4556: Strip margins and heights from CSS in comments.U trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl 2009-07-09 17:18:46 UTC (rev 15455)
+++ trunk/cgi-bin/cleanhtml.pl 2009-07-09 18:21:20 UTC (rev 15456)
@@ -146,6 +146,7 @@
my $suspend_msg = $opts->{'suspend_msg'} || 0;
my $unsuspend_supportid = $opts->{'unsuspend_supportid'} || 0;
my $remove_all_attribs = $opts->{'remove_all_attribs'} || 0;
+ my $remove_positioning = $opts->{'remove_positioning'} || 0;
my @canonical_urls; # extracted links
my %action = ();
@@ -637,6 +638,10 @@
if ($remove_fonts) {
$hash->{style} =~ s/font-family:.*?(?:;|$)//gi;
}
+ if ($remove_positioning) {
+ $hash->{style} =~ s/margin.*?(?:;|$)//gi;
+ $hash->{style} =~ s/height\s*?:.*?(?:;|$)//gi;
+ }
}
if ($opts->{'clean_js_css'} && ! $LJ::DISABLED{'css_cleaner'}) {
@@ -1401,6 +1406,7 @@
'tablecheck' => 1,
'nocss' => $opts->{'nocss'},
'textonly' => $opts->{'textonly'} ? 1 : 0,
+ 'remove_positioning' => 1,
});
}