Index: intltool-merge.in.in
===================================================================
RCS file: /cvs/gnome/intltool/intltool-merge.in.in,v
retrieving revision 1.93
diff -u -r1.93 intltool-merge.in.in
--- intltool-merge.in.in	2 Mar 2004 22:06:41 -0000	1.93
+++ intltool-merge.in.in	3 Mar 2004 02:45:01 -0000
@@ -605,24 +605,22 @@
     my $depth     = shift || 0;
     my $language  = shift || "";
     my $not_cdata = 0;
+    my $cdata_follows = 0;
     my $has_children;
 
     $entered_tag[$depth + 1] = 0;
 
-    # Check to see if this is not a CDATA element.
-    #
-    foreach my $sub (@{ $ref }) {
-        if (ref $sub eq 'ARRAY') {
-            $not_cdata = 1;
-        }
-    }
 
     foreach my $sub (@{ $ref }) {
 
+    	$not_cdata = !$cdata_follows;
         # Handle empty nodes.
         #
         if (! $sub) {
+	    $cdata_follows = 1;
             next;
+        } else {
+            $cdata_follows = 0;
         }
 
         if (ref $sub eq 'ARRAY') {
@@ -848,6 +846,16 @@
                 # Handle CDATA
                 #
                 my $string = $sub;
+                my $leading_space = '';
+                my $trailing_space = '';
+
+                if ($string =~ /^(\s+)/) {
+                    $leading_space = $1;
+                }
+
+                if ($string =~ /(\s+)$/) {
+                    $trailing_space = $1;
+                }
 
                 $string =~ s/\s+/ /g;
                 $string =~ s/^ //;
@@ -869,7 +877,7 @@
                     }
                 }
 
-                print $fh $string;
+                print $fh $leading_space, $string, $trailing_space;
             }
         }
     }
