Changeset 22653
- Timestamp:
- 2010-08-17T16:42:14+12:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/perllib/ghtml.pm
r17058 r22653 66 66 { 67 67 $_[0] =~ s/[\x09\x20\x22\x3c\x3e\x5b\x5c\x5d\x5e\x60\x7b\x7c\x7d\x7e\?\=\&\+_\/]/sprintf("%%%2x", ord($&))/gse; 68 }69 70 # dmsafe71 #72 # Converts characters which could make display.pl or html crack to their entity references.73 # Don't use this on dm macros as they will no longer be recognisable by dm (which74 # by the way, is the whole idea).75 # -- Rodger 12/1/9876 sub dmsafe {77 my ($s) = $_[0];78 $s =~ s/&/&/osg; # for html79 $s =~ s/</</osg; # for html80 $s =~ s/>/>/osg; # for html81 $s =~ s/\_/_/osg; # for dm (we have a convention of starting macros with _82 $s =~ s/\"/"/osg; # for html (don't want to be interpreted as a quote)83 $s =~ s/\{/{/osg; # for dm blocks84 $s =~ s/\}/}/osg; # for dm blocks85 $s =~ s/\\/\/osg; # for dm (dm removes naturally occurring backquotes)86 return $s;87 68 } 88 69
Note:
See TracChangeset
for help on using the changeset viewer.