summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-07-10 14:38:51 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-07-10 14:38:51 +0000
commit9f4a3d2ed291d81d20e716c9e6fa77fafbf154ce (patch)
treef333cb53a35a786ed37e5ebac3bcde5f74bda525 /mdoc_validate.c
parent8ee1f84ff5585f3a387605ad0aa5b95beb7a4204 (diff)
downloadmandoc-9f4a3d2ed291d81d20e716c9e6fa77fafbf154ce.tar.gz
* implement -Tman .Bl -item -inset -diag -ohang -dash -hyphen -enum .It
* fix -Tman .Bl -bullet .It * adjust the -Tascii .Bl -bullet -dash -hyphen .It default and minimum width to new groff standards, it changed from 4n (in groff 1.15) to 2n (in groff 1.21) * same for -Tascii -enum, it changed from 5n to 2n * use -hang formatting for -Tascii -enum -width 2n * for -Tascii -enum, the default is -width 3n
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 261a3030..b8c4c0f8 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -733,14 +733,14 @@ pre_bl(PRE_ARGS)
/*
* Validate the width field. Some list types don't need width
* types and should be warned about them. Others should have it
- * and must also be warned.
+ * and must also be warned. Yet others have a default and need
+ * no warning.
*/
switch (n->norm->Bl.type) {
case (LIST_tag):
- if (n->norm->Bl.width)
- break;
- mdoc_nmsg(mdoc, n, MANDOCERR_NOWIDTHARG);
+ if (NULL == n->norm->Bl.width)
+ mdoc_nmsg(mdoc, n, MANDOCERR_NOWIDTHARG);
break;
case (LIST_column):
/* FALLTHROUGH */
@@ -754,6 +754,18 @@ pre_bl(PRE_ARGS)
if (n->norm->Bl.width)
mdoc_nmsg(mdoc, n, MANDOCERR_IGNARGV);
break;
+ case (LIST_bullet):
+ /* FALLTHROUGH */
+ case (LIST_dash):
+ /* FALLTHROUGH */
+ case (LIST_hyphen):
+ if (NULL == n->norm->Bl.width)
+ n->norm->Bl.width = "2n";
+ break;
+ case (LIST_enum):
+ if (NULL == n->norm->Bl.width)
+ n->norm->Bl.width = "3n";
+ break;
default:
break;
}