SCHEMATRON-BASIC=$(SCHEMATRON-PATH)/schematron-basic.xsl
SCHEMATRON-PATH=/share/doctypes/schematron
SCHEMATRON-SKELETON=$(SCHEMATRON-PATH)/skeleton1-5.xsl
-TIDY=tidy
+TIDY=$(CVSTOOLSROOT)/untidy
XJPARSE=$(CVSTOOLSROOT)/xjparse
XNSGMLS=xnsgmls
XSLT=$(CVSTOOLSROOT)/xslt
--- /dev/null
+#!/usr/bin/perl -w -- # -*- Perl -*-
+
+my $filename = pop @ARGV;
+my $opts = join(" ", @ARGV);
+
+my $content = "";
+
+open (F, "tidy $opts $filename |");
+while (<F>) {
+ $content .= $_;
+}
+close (F);
+
+if ($content eq '') {
+ # we must have done an "in-place" tidy
+ if (open (F, $filename)) {
+ read (F, $content, -s $filename);
+ close (F);
+ }
+}
+
+$content =~ s/(<a\s[^>]+>)\s+/$1/sg;
+
+open (F, ">$filename");
+print F $content;
+close (F);