Henry Lyne ([info]henrylyne) wrote in [info]changelog,
@ 2009-07-09 18:21:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
[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,
     });
 }
 



(5 comments) - (Post a new comment)


[info]rahaeli
2009-07-09 11:13 pm UTC (link)
\o/

(Reply to this) (Thread)


[info]henrylyne
2009-07-09 11:24 pm UTC (link)
Thanks!
Patch by [info - staff]denise

(Reply to this) (Parent)(Thread)


[info]rahaeli
2009-07-09 11:28 pm UTC (link)
My very first upstreamed patch! I'm all proud and shit.

(Reply to this) (Parent)


[info]azurelunatic
2009-07-09 11:16 pm UTC (link)
Hooray!

(perhaps also worth thinking about for entries?)

(Reply to this)


[info]thelittlevoice
2009-07-10 03:21 am UTC (link)
Is there a similar one for entries? In entries...I've seen this wreak havoc on communities and on friend's pages.

(Reply to this)


(5 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…