diff options
author | kdubost <kdubost@localhost> | 2008-07-14 03:15:25 +0000 |
---|---|---|
committer | kdubost <kdubost@localhost> | 2008-07-14 03:15:25 +0000 |
commit | 54e7b7bc86ef0e5f7122ff59555c22eb9ca5a879 (patch) | |
tree | 3d97975dd602f6b646a1f5b6cbd6f9333db6132b | |
parent | 62e73411f555abfed9ea72a36be18ef4f86b85e7 (diff) | |
download | markup-validator-54e7b7bc86ef0e5f7122ff59555c22eb9ca5a879.zip markup-validator-54e7b7bc86ef0e5f7122ff59555c22eb9ca5a879.tar.gz markup-validator-54e7b7bc86ef0e5f7122ff59555c22eb9ca5a879.tar.bz2 |
Adding support for JSON output following the format of Validator.nu mostly
-rwxr-xr-x | httpd/cgi-bin/check | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/httpd/cgi-bin/check b/httpd/cgi-bin/check index f322cc2..004feb1 100755 --- a/httpd/cgi-bin/check +++ b/httpd/cgi-bin/check @@ -14,7 +14,7 @@ # This source code is available under the license at: # http://www.w3.org/Consortium/Legal/copyright-software # -# $Id: check,v 1.590 2008-06-30 18:45:56 ot Exp $ +# $Id: check,v 1.591 2008-07-14 03:15:25 kdubost Exp $ # # Disable buffering on STDOUT! @@ -188,7 +188,7 @@ Directory not readable (permission denied): @_r # # Strings - $VERSION = q$Revision: 1.590 $; + $VERSION = q$Revision: 1.591 $; $VERSION =~ s/Revision: ([\d\.]+) /$1/; # @@ -394,7 +394,14 @@ $File->{Templates}->{EARLN3} = HTML::Template->new( global_vars => TRUE, filter => sub { my $ref = shift;${$ref} = Encode::decode_utf8(${$ref});} ); - +$File->{Templates}->{JSON} = HTML::Template->new( + %template_defaults, + filename => File::Spec->catfile($CFG->{Paths}->{Templates}, + $lang, 'json_ouput.tmpl'), + loop_context_vars => TRUE, + global_vars => TRUE, + filter => sub { my $ref = shift;${$ref} = Encode::decode_utf8(${$ref});} +); $File->{Templates}->{PrefillHTML} = HTML::Template->new( %template_defaults, filename => File::Spec->catfile($CFG->{Paths}->{Templates}, @@ -1000,6 +1007,8 @@ if ($File->{Opt}->{Output} eq 'xml') { $template = $File->{Templates}->{EARLXML}; } elsif ($File->{Opt}->{Output} eq 'n3') { $template = $File->{Templates}->{EARLN3}; +} elsif ($File->{Opt}->{Output} eq 'json') { + $template = $File->{Templates}->{JSON}; } elsif ($File->{Opt}->{Output} eq 'ucn') { $template = $File->{Templates}->{UCN}; } elsif ($File->{Opt}->{Output} eq 'soap12') { |