aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_term.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_term.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_term.c')
-rw-r--r--mdoc_term.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/mdoc_term.c b/mdoc_term.c
index 36181778..eeda5537 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.241 2012/07/09 23:53:36 schwarze Exp $ */
+/* $Id: mdoc_term.c,v 1.242 2012/07/10 14:38:51 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -727,12 +727,10 @@ termp_it_pre(DECL_ARGS)
case (LIST_dash):
/* FALLTHROUGH */
case (LIST_hyphen):
- if (width < term_len(p, 4))
- width = term_len(p, 4);
- break;
+ /* FALLTHROUGH */
case (LIST_enum):
- if (width < term_len(p, 5))
- width = term_len(p, 5);
+ if (width < term_len(p, 2))
+ width = term_len(p, 2);
break;
case (LIST_hang):
if (0 == width)
@@ -787,12 +785,18 @@ termp_it_pre(DECL_ARGS)
*/
switch (type) {
+ case (LIST_enum):
+ /*
+ * Weird special case.
+ * Very narrow enum lists actually hang.
+ */
+ if (width == term_len(p, 2))
+ p->flags |= TERMP_HANG;
+ /* FALLTHROUGH */
case (LIST_bullet):
/* FALLTHROUGH */
case (LIST_dash):
/* FALLTHROUGH */
- case (LIST_enum):
- /* FALLTHROUGH */
case (LIST_hyphen):
if (MDOC_HEAD == n->type)
p->flags |= TERMP_NOBREAK;