From: Norman Walsh Date: Mon, 12 Nov 2001 21:29:05 +0000 (+0000) Subject: Use untidy to restore the broken anchors that tidy creates...grrr X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6053dcdeb1283f21de5b399f38f08f6699f2ed29;p=docbook-dsssl Use untidy to restore the broken anchors that tidy creates...grrr --- diff --git a/cvstools/Makefile.incl b/cvstools/Makefile.incl index 9d8f6a8ca..54651cc19 100644 --- a/cvstools/Makefile.incl +++ b/cvstools/Makefile.incl @@ -6,7 +6,7 @@ NEXTVERSION=$(CVSTOOLSROOT)/nextversion 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 diff --git a/cvstools/untidy b/cvstools/untidy new file mode 100755 index 000000000..9a132f286 --- /dev/null +++ b/cvstools/untidy @@ -0,0 +1,26 @@ +#!/usr/bin/perl -w -- # -*- Perl -*- + +my $filename = pop @ARGV; +my $opts = join(" ", @ARGV); + +my $content = ""; + +open (F, "tidy $opts $filename |"); +while () { + $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/(]+>)\s+/$1/sg; + +open (F, ">$filename"); +print F $content; +close (F);