madeon (madeon) wrote in changelog,
madeon
madeon
changelog

[livejournal] r21200: LJSUP-11267: added clean html -> xhtml

Committer: sbelyaev
LJSUP-11267: added clean html -> xhtml
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2012-02-16 13:15:11 UTC (rev 21199)
+++ trunk/cgi-bin/ljprotocol.pl	2012-02-16 13:22:38 UTC (rev 21200)
@@ -18,6 +18,7 @@
                       LJ::EmbedModule
                       LJ::DelayedEntry
                       LJ::PushNotification
+                      LJ::Tidy
                       );
 
 use LJ::TimeUtil;
@@ -3906,7 +3907,13 @@
             $t->[1] =~ s/\n/\r\n/g;
         }
 
-        $evt->{'event'} = $t->[1];
+        if ($req->{'asxml'}) {
+            my $tidy = LJ::Tidy->new( { output => 'xml' } );
+            my $event_text = $tidy->clean( $t->[1] );
+            $evt->{'event'} = '<event>' . $event_text . '</event>';
+        } else {
+            $evt->{'event'} = $t->[1];
+        }
     }
 
     # maybe we don't need the props after all

Tags: livejournal, madeon, pl, sbelyaev
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