Changeset 1279 for branches/New_Config_Format-branch/gsdl/perllib/ghtml.pm
- Timestamp:
- 2000-07-13T10:21:53+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New_Config_Format-branch/gsdl/perllib/ghtml.pm
r1010 r1279 34 34 sub htmlsafe 35 35 { 36 $_[0] =~ s/&/&/og; 37 $_[0] =~ s/</</og; 38 $_[0] =~ s/>/>/og; 36 $_[0] =~ s/&/&/osg; 37 $_[0] =~ s/</</osg; 38 $_[0] =~ s/>/>/osg; 39 $_[0] =~ s/\"/"/osg; 39 40 } 40 41 … … 45 46 sub urlsafe 46 47 { 47 $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/g e;48 $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/gse; 48 49 } 49 50 … … 56 57 sub dmsafe { 57 58 my ($s) = $_[0]; 58 $s =~ s/&/&/og; # for html 59 $s =~ s/</</og; # for html 60 $s =~ s/>/>/og; # for html 61 $s =~ s/\_/_/og; # for dm (we have a convention of starting macros with _ 62 $s =~ s/\"/"/og; # for html (don't want to be interpreted as a quote) 63 $s =~ s/\{/{/og; # for dm blocks 64 $s =~ s/\}/}/og; # for dm blocks 59 $s =~ s/&/&/osg; # for html 60 $s =~ s/</</osg; # for html 61 $s =~ s/>/>/osg; # for html 62 $s =~ s/\_/_/osg; # for dm (we have a convention of starting macros with _ 63 $s =~ s/\"/"/osg; # for html (don't want to be interpreted as a quote) 64 $s =~ s/\{/{/osg; # for dm blocks 65 $s =~ s/\}/}/osg; # for dm blocks 66 $s =~ s/\\/\/osg; # for dm (dm removes naturally occurring backquotes) 65 67 return $s; 66 68 } … … 170 172 # args: the text that you want to convert 171 173 172 $_[0] =~ s/&([^;]+);/&getcharequiv($1,0)/g e;174 $_[0] =~ s/&([^;]+);/&getcharequiv($1,0)/gse; 173 175 } 174 176 … … 177 179 # args: the text that you want to convert 178 180 179 $_[0] =~ s/&([^;]+);/&getcharequiv($1,1)/g e;181 $_[0] =~ s/&([^;]+);/&getcharequiv($1,1)/gse; 180 182 } 181 183
Note:
See TracChangeset
for help on using the changeset viewer.