summaryrefslogtreecommitdiff
path: root/doc/doc-docbook/TidyHTML-spec
diff options
context:
space:
mode:
authorPhilip Hazel <ph10@hermes.cam.ac.uk>2006-04-04 14:03:49 +0000
committerPhilip Hazel <ph10@hermes.cam.ac.uk>2006-04-04 14:03:49 +0000
commit4f5788623ab3e8456ad254883b6cc018079aab96 (patch)
tree7a0d0f19d4687941f80d25cab01e9c8ddb2fac25 /doc/doc-docbook/TidyHTML-spec
parentbd8aa2d172edfb841402caf8c2524628505df8ea (diff)
Update documentation for 4.61 and some of the preparation tools.
Diffstat (limited to 'doc/doc-docbook/TidyHTML-spec')
-rwxr-xr-xdoc/doc-docbook/TidyHTML-spec24
1 files changed, 18 insertions, 6 deletions
diff --git a/doc/doc-docbook/TidyHTML-spec b/doc/doc-docbook/TidyHTML-spec
index c1bc994cd..4e7b8a2ca 100755
--- a/doc/doc-docbook/TidyHTML-spec
+++ b/doc/doc-docbook/TidyHTML-spec
@@ -1,6 +1,6 @@
#! /usr/bin/perl
-# $Cambridge: exim/doc/doc-docbook/TidyHTML-spec,v 1.3 2006/02/01 11:01:01 ph10 Exp $
+# $Cambridge: exim/doc/doc-docbook/TidyHTML-spec,v 1.4 2006/04/04 14:03:49 ph10 Exp $
# Script to tidy up the spec HTML files that are generated by xmlto. The
# following changes are made:
@@ -15,7 +15,7 @@
# 6. Before each occurrence of </td> insert &nbsp; so that the table's cell
# is a little bit wider than the text itself.
-chdir "spec.html";
+chdir "spec_html";
$tocref = 1;
@@ -25,11 +25,23 @@ open(IN, "index.html") || die "Failed to open index.html for reading: $!\n";
@toc = <IN>;
close(IN);
-# Insert a newline after every > because the whole toc is generated as one
-# humungous line that is hard to check. Then split the lines so that each one
-# is a separate element in the vector.
+# Insert a newline after every > except when it is preceded by 'class="quote"',
+# because the whole toc is generated as one humungous line that is hard to
+# check. We have to avoid it in the quote case because that puts a space into
+# the output, and similarly for the </span> the comes afterwards. Easy way out
+# is just not to do it for all </span> occurrences. Unfortunately, Perl does
+# not implement lookbehinds where the alternatives are of different lengths, so
+# we have to take two passes.
+
+
+foreach $line (@toc)
+ {
+ $line =~ s/(?<!class="quote")>\s*/>\n/g;
+ $line =~ s/<\/span>\n/<\/span>/g;
+ }
+
+# Split the lines so that each one is a separate element in the vector.
-foreach $line (@toc) { $line =~ s/>\s*/>\n/g; }
for ($i = 0; $i < scalar(@toc); $i++)
{ splice @toc, $i, 1, (split /(?<=\n)/, $toc[$i]); }