# File:        shared/Template.pm                                              #
 #                                                                              #
 # Authors:     AndrĂ© Malo <nd@o3media.de>, 2001-04-12                          #
+#              Frank Schoenmann <fs@tower.de>, 2001-06-04                      #
 #                                                                              #
 # Description: Handle XML based HTML-Templates                                 #
 #                                                                              #
 #
 # fill in a template scrap
 #
-# Params: $name - name of the scrap
+# Params: $name    name of the scrap
+#         ...
+#         $no_nl   1 - remove newlines (\n)
+#                  0 - do no such thing
 #
 # Return: scalar reference - filled in scrap
 #
   my $self = shift;
   my $name = shift;
 
+  my $no_nl;
+  if (!ref $_[$#_]) {
+      $no_nl = pop @_;
+  }
+
   croak "no template file specified"
     unless (defined $self -> {file});
 
     \%params
   );
 
+  # remove newlines
+  $scrap =~ s/\n|\r\n|\n\r|\r//g if ($no_nl);
+
   # return
   \$scrap;
 }
 
 #
 #
-### end of Template ############################################################
\ No newline at end of file
+### end of Template ############################################################