slartyblartfast (slartyblartfast) wrote in changelog,
slartyblartfast
slartyblartfast
changelog

[livejournal] r15014: LJGI-33: Added 'eat all unknown tags' fe...

Committer: mchernyshev
LJGI-33: Added 'eat all unknown tags' feature.

U   trunk/cgi-bin/cleanhtml.pl
Modified: trunk/cgi-bin/cleanhtml.pl
===================================================================
--- trunk/cgi-bin/cleanhtml.pl	2009-03-18 04:44:52 UTC (rev 15013)
+++ trunk/cgi-bin/cleanhtml.pl	2009-03-18 08:57:50 UTC (rev 15014)
@@ -126,6 +126,7 @@
     my $addbreaks = $opts->{'addbreaks'};
     my $keepcomments = $opts->{'keepcomments'};
     my $mode = $opts->{'mode'};
+    my $undefined_tags = $opts->{undefined_tags} || '';
     my $cut = $opts->{'cuturl'} || $opts->{'cutpreview'};
     my $ljcut_disable = $opts->{'ljcut_disable'};
     my $s1var = $opts->{'s1var'};
@@ -374,7 +375,9 @@
             # because IE understands them.
             $tag =~ s!/.+$!!;
 
-            if ($action{$tag} eq "eat") {
+            # Try to execute default action on undefined tags
+            if ((!$action{$tag} && $undefined_tags eq "eat") 
+             or ($action{$tag} eq "eat")) {
                 $p->unget_token($token);
                 $p->get_tag("/$tag");
                 next;

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