aboutsummaryrefslogtreecommitdiffstatshomepage
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
commit93d3ffc3d342e3e9214ceb0ba55d157aa51d70b7 (patch)
treeee9954f0b8f98a9dd5fc2e801db6f17ba73bd025 /mdoc_validate.c
parent46e3c278c370d1404debff5aa25ae184a3e13a14 (diff)
downloadmandoc-93d3ffc3d342e3e9214ceb0ba55d157aa51d70b7.tar.gz
mandoc-93d3ffc3d342e3e9214ceb0ba55d157aa51d70b7.tar.zst
mandoc-93d3ffc3d342e3e9214ceb0ba55d157aa51d70b7.zip
* 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.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index d4a0b8d3..0e31ee06 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.184 2012/05/27 17:48:57 schwarze Exp $ */
+/* $Id: mdoc_validate.c,v 1.185 2012/07/10 14:38:51 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;
}