bagder: curl-www/docs txt2plain.pl,NONE,1.1
| Newsgroups | gmane.comp.web.curl.www.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/curl/curl-www/docs
In directory labb:/tmp/cvs-serv28696
Added Files:
txt2plain.pl
Log Message:
add script here and make all of the site use this
--- NEW FILE: txt2plain.pl ---
#!/usr/bin/perl
while(<STDIN>) {
# convert <> to html-codes
$_ =~ s/\</</g;
$_ =~ s/\>/>/g;
# empty lines become
$_ =~ s/^[ \t]*$/\ /g;
# trailing backslashes become \
$_ =~ s/\\$/\\ /;
# convert the begining of a "C comment" to a html code to prevent the
# cpp to barf
$_ =~ s/\/\*/&\#47;*/g;
# convert URLs to <a href>
$_ =~ s/((http|ftp):\/\/([a-zA-Z0-9.=\/_%?-]*[0-9A-Za-z\/]))/<a href=\"$2:\/\/$3\">$1<\/a>/g;
print $_;
}