aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-19 03:11:59 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-09-19 03:11:59 +0000
commit47f847e71f6c025c918843a3d1355f0f6ea6dc4c (patch)
tree3557e1dae0543135678a780383c9b5f785fc1315
parentd9dedf08139e60fddfb0cd7e03c2f4ec9e48aae7 (diff)
downloadpandoc-47f847e71f6c025c918843a3d1355f0f6ea6dc4c.tar.gz
Removed html2x.pl -- it belongs in its own repository.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1030 788f1e2b-df1e-0410-8736-df70ead52e1b
-rwxr-xr-xweb/html2x.pl40
1 files changed, 0 insertions, 40 deletions
diff --git a/web/html2x.pl b/web/html2x.pl
deleted file mode 100755
index 86f71196e..000000000
--- a/web/html2x.pl
+++ /dev/null
@@ -1,40 +0,0 @@
-#!/usr/bin/env perl
-use strict;
-use CGI qw/:standard/;
-use CGI::Carp 'fatalsToBrowser';
-
-$CGI::POST_MAX=1024 * 100; # max 100K posts
-$CGI::DISABLE_UPLOADS = 1; # no uploads
-
-param('url') && param('format') or die "Missing url and/or format parameters.\n";
-
-my $options = '-r html --standalone --reference-links';
-my $url = param('url');
-my $format = param('format') || 'markdown';
-if ($format =~ /^markdown$/) {
- $options .= ' --strict';
-}
-if ($format =~ /^markdown\+$/) {
- $format = 'markdown';
-}
-
-# Validate URL and format
-unless ($url =~ /^(https?:\/\/)?[\w#_-]+(\.[\w#_-]+)+(:\d+)?[\w\/#=:?_.-]*$/) {
- die "Illegal URL: $url\n" ;
-}
-unless ($format =~ /^markdown\+?|rst|latex|context|rtf|man|docbook$/) {
- die "Illegal format: $format\n";
-}
-
-# Note - pass through head to truncate file to 100K if greater.
-# This should prevent certain kinds of DoS attacks.
-my $output = `wget -O- $url | head -c100000 | tidy -asxhtml -utf8 | pandoc -w $format $options`;
-if ($output =~ /^\s*$/) {
- print start_html,
- h1("No output"),
- p("Either $url could not be retrieved, or its HTML was too malformed to parse."),
- end_html;
- exit 0;
-}
-print header(-charset=>"utf8",-type=>"text/plain"),
- $output;