1 # Copyright 2002-2007 Interchange Development Group and others
3 # This program is free software; you can redistribute it and/or modify
4 # it under the terms of the GNU General Public License as published by
5 # the Free Software Foundation; either version 2 of the License, or
6 # (at your option) any later version. See the LICENSE file for details.
8 # $Id: jsqn.coretag,v 1.7 2007-03-30 23:40:54 pajamian Exp $
10 UserTag jsqn hasEndTag
11 UserTag jsqn NoReparse
12 UserTag jsqn PosNumber 0
13 UserTag jsqn Version $Revision: 1.7 $
14 UserTag jsqn Routine <<EOR
17 $text =~ s/^[ \t\r]*\n//;
18 my @lines = split /\r?\n/, $text;
21 ( $_ !~ /'/ and s/\r/\\r/g, $_ = qq{'$_'} )
23 ( $_ !~ /"/ and s/\r/\\r/g, $_ = qq{"$_"} )
25 ( s/'/\\'/g, s/\r/\\r/g, $_ = qq{'$_'} );
27 @lines = "''" unless @lines;
28 return join (" +\n", @lines);