Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r21168: LJSUP-10691: Image placeholders in comme...

Committer: amyshkin
LJSUP-10691: Image placeholders in comments
U   trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2012-02-13 12:46:40 UTC (rev 21167)
+++ trunk/cgi-bin/cleanhtml.pl	2012-02-13 13:25:29 UTC (rev 21168)
@@ -352,14 +352,16 @@
                 next TOKEN;
             }
 
-            if ( $tag eq 'a' ) {
-                $in_link = 1;
-                $href_b_link = $attr->{href};
-            }
+            if ( $opts->{'img_placeholders'} ) {
+                if ( $tag eq 'a' ) {
+                    $in_link = 1;
+                    $href_b_link = $attr->{href};
+                }
 
-            if ( $tag eq 'img' && $in_link ) {
-                $img_link = 1;
-                $newdata .= '</a>';
+                if ( $tag eq 'img' && $in_link ) {
+                    $img_link = 1;
+                    $newdata .= '</a>';
+                }
             }
 
             if ($tag eq "lj-template" && ! $noexpand_embedded) {
@@ -1310,12 +1312,14 @@
                 next TOKEN;
             }
 
-            if ( $tag eq 'a' && $in_link ) {
-                $in_link     = 0;
-                $text_b_link = 0;
-                $text_b_link = 0;
-                $href_b_link = '';
-                $img_link    = 0;
+            if ( $opts->{'img_placeholders'} ) {
+                if ( $tag eq 'a' && $in_link ) {
+                    $in_link     = 0;
+                    $text_b_link = 0;
+                    $text_b_link = 0;
+                    $href_b_link = '';
+                    $img_link    = 0;
+                }
             }
 
             my $allow;
@@ -1461,12 +1465,14 @@
                 next TOKEN;
             }
 
-            if ( $in_link && $img_link ) {
-                $newdata .= qq~<a href="$href_b_link">~
-                    . $token->[1]
-                    . '</a>';
-                $text_a_link = 1;
-                next TOKEN;
+            if ( $opts->{'img_placeholders'} ) {
+                if ( $in_link && $img_link ) {
+                    $newdata .= qq~<a href="$href_b_link">~
+                        . $token->[1]
+                        . '</a>';
+                    $text_a_link = 1;
+                    next TOKEN;
+                }
             }
 
             if ($eating_ljuser_span) {

Tags: amyshkin, livejournal, pl, zilogic
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments