]> git.cameronkatri.com Git - mandoc.git/blobdiff - mdoc_validate.c
Ugly fix for `Bl' or `Bd' causing badness when nested in `Bl -hang' lists.
[mandoc.git] / mdoc_validate.c
index 5d2be45032d1383e433492657f556eb4ccd5478d..797642aaf7aec3194435aa39c171baf7c04b3ce7 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: mdoc_validate.c,v 1.36 2009/07/17 12:40:48 kristaps Exp $ */
+/*     $Id: mdoc_validate.c,v 1.39 2009/07/23 08:36:32 kristaps Exp $ */
 /*
  * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
  *
@@ -862,7 +862,7 @@ post_bf(POST_ARGS)
                return(1);
        else if (0 == strcmp(p, "Li"))
                return(1);
-       else if (0 == strcmp(p, "Sm"))
+       else if (0 == strcmp(p, "Sy"))
                return(1);
 
        return(mdoc_nerr(mdoc, head, EFONT));
@@ -1028,11 +1028,20 @@ post_it(POST_ARGS)
                c = mdoc->last->child;
                for (i = 0; c && MDOC_HEAD == c->type; c = c->next)
                        i++;
-               if (i == cols)
+
+               if (i < cols || i == (cols + 1)) {
+                       if ( ! mdoc_vwarn(mdoc, mdoc->last->line, 
+                                       mdoc->last->pos, "column "
+                                       "mismatch: have %d, want %d", 
+                                       i, cols))
+                               return(0);
                        break;
-               return(mdoc_verr(mdoc, mdoc->last->line, mdoc->last->pos,
-                               "column mismatch (have %d, want %d)", 
-                               i, cols));
+               } else if (i == cols)
+                       break;
+
+               return(mdoc_verr(mdoc, mdoc->last->line, 
+                               mdoc->last->pos, "column mismatch: "
+                               "have %d, want %d", i, cols));
        default:
                break;
        }