about summary refs log tree commit diff
diff options
context:
space:
mode:
-rwxr-xr-xbuildtools/makeman24
-rw-r--r--doc/HISTORY5
2 files changed, 17 insertions, 12 deletions
diff --git a/buildtools/makeman b/buildtools/makeman
index 538accad..13c54a70 100755
--- a/buildtools/makeman
+++ b/buildtools/makeman
@@ -160,7 +160,7 @@ def makeman(name, file, indoc):
         if xrefsection == 0:
             return "\n.I " + xrefto
         else:
-            return "\n.BR %s (%d)\n" % (xrefto, xrefsection)
+            return '\n.BR "%s" (%d)\\c\n\\&' % (xrefto, xrefsection)
     indoc = re.sub(r'(?i)\n* *(?:\\fB)?<A[ \n]+HREF="?([^>]+.html)"?>([^<]+)</A>(?:\\fP)?',
                    xrefmatch, indoc)
     # Format URLs
@@ -231,25 +231,25 @@ def makeman(name, file, indoc):
     indoc = indoc.replace("&mu;", "mu")
     indoc = indoc.replace("&sigma;", "sigma")
     # Tables
-    indoc = re.sub(' *<table[^>]*>.*', ".TS", indoc)
-    indoc = re.sub(" *</table>.*", ".TE", indoc)
+    indoc = re.sub('(?i) *<table[^>]*>.*', ".TS", indoc)
+    indoc = re.sub("(?i) *</table>.*", ".TE", indoc)
     # First the single-line case
-    indoc = re.sub("</td> *<td>", "\t", indoc)
-    indoc = re.sub("<tr> *<td>", "", indoc)
-    indoc = re.sub("</td> *</tr>", "", indoc)
+    indoc = re.sub("(?i)</td> *<td>", "\t", indoc)
+    indoc = re.sub("(?i)<tr> *<td>", "", indoc)
+    indoc = re.sub("(?i)</td> *</tr>", "", indoc)
     # Then the multiline case
-    indoc = re.sub(r'\s*<t[hd][^>]*>([^<\n]*)</t[dh]>\s*', '\t\\1', indoc)
-    indoc = re.sub(r'\s*<t[hd][^>]*>([^<]*)</t[dh]>\s*', '\tT{\n\\1T}', indoc)
+    indoc = re.sub(r'(?i)\s*<t[hd][^>]*>([^<\n]*)</t[dh]>\s*', '\t\\1', indoc)
+    indoc = re.sub(r'(?i)\s*<t[hd][^>]*>([^<]*)</t[dh]>\s*', '\tT{\n\\1T}', indoc)
     indoc = indoc.replace("\n\\&T}", "\nT}")
-    indoc = re.sub(" *</tr>", "", indoc)
-    indoc = re.sub(" *<tr[^>]*>\t*", "", indoc)
-    indoc = re.sub(r"\.TS\s+<caption>([^<]*)</caption>\s*", ".B \\1\n.TS\n", indoc)
+    indoc = re.sub("(?i) *</tr>", "", indoc)
+    indoc = re.sub("(?i) *<tr[^>]*>\t*", "", indoc)
+    indoc = re.sub(r"\.TS\s+<[Cc][Aa][Pp][Tt][Ii][Oo][Nn]>([^<]*)</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]>\s*", ".B \\1\n.TS\n", indoc)
     # Debugging
     #sys.stderr.write("Name: %s, Title: %s, Date: %s\n" % (name, title, date))
     # Time for error checking now
     badlines = []
     for line in indoc.split("\n"):
-        if "<" in line or ">" in line.replace(" >", "") or re.search("&.*;", line):
+        if "<" in line or ">" in line.replace(" >", "") or re.search(r'(?<!^\\)&.*;', line):
             badlines.append(line)
     if badlines:
         sys.stderr.write(("Bad lines from %s:\n-----------------\n" % file) + "\n".join(badlines) + "\n-----------------\n")
diff --git a/doc/HISTORY b/doc/HISTORY
index f0a712cb..32e58267 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -6,6 +6,9 @@ CHANGE HISTORY
 
 not yet  BJH  Release 10.77.00
 
+              Makeman: slight improvement to formatting of man pages.
+              Thanks Werner LEMBERG <wl@gnu.org>.
+
 16.09.27 BJH  Release 10.76.00
 
               pnmquantall: Fix failure when temporary file location is
@@ -21,6 +24,8 @@ not yet  BJH  Release 10.77.00
               cmuwmtopbm: fix trivial memory leak.  Always broken (cmuwmtopbm
               was in primordial Pbmplus, in 1988).
 
+              Build: Add PKG_CONFIG make variable.
+
               Build: tifftopnm.c: fix undefined WIFSIGNALED, etc. in 
 
 16.06.26 BJH  Release 10.75.00