-/* $Id: mdoc_term.c,v 1.37 2009/07/12 20:50:08 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.38 2009/07/13 07:23:07 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
/* FALLTHROUGH */
case (MDOC_Column):
/* FALLTHROUGH */
+ case (MDOC_Hang):
+ /* FALLTHROUGH */
case (MDOC_Ohang):
return(n->args->argv[i].arg);
default:
break;
}
- /* FIXME: mandated by parser. */
-
- errx(1, "list type not supported");
- /* NOTREACHED */
+ return(-1);
}
(void)arg_getattrs(keys, vals, 3, bl);
type = arg_listtype(bl);
+ assert(-1 != type);
/* Calculate real width and offset. */
/*
* List-type can override the width in the case of fixed-head
* values (bullet, dash/hyphen, enum). Tags need a non-zero
- * offset.
+ * offset. FIXME: double-check that correct.
*/
switch (type) {
if (width < 5)
width = 5;
break;
+ case (MDOC_Hang):
+ /* FALLTHROUGH */
case (MDOC_Tag):
if (0 == width)
width = 10;
case (MDOC_Diag):
term_word(p, "\\ ");
/* FALLTHROUGH */
+ case (MDOC_Hang):
+ /* FALLTHROUGH */
case (MDOC_Inset):
if (MDOC_BODY == node->type)
p->flags &= ~TERMP_NOSPACE;
/* FALLTHROUGH */
case (MDOC_Hyphen):
/* FALLTHROUGH */
+ case (MDOC_Hang):
+ /* FALLTHROUGH */
case (MDOC_Tag):
if (MDOC_HEAD == node->type)
p->flags |= TERMP_NOBREAK;
else
p->flags |= TERMP_NOLPAD;
+
+ if (MDOC_HEAD == node->type && MDOC_Hang == type)
+ p->flags |= TERMP_NONOBREAK;
+
if (MDOC_HEAD == node->type && MDOC_Tag == type)
if (NULL == node->next ||
NULL == node->next->child)
/* FALLTHROUGH */
case (MDOC_Hyphen):
/* FALLTHROUGH */
+ case (MDOC_Hang):
+ /* FALLTHROUGH */
case (MDOC_Tag):
if (MDOC_HEAD == node->type)
p->rmargin = p->offset + width;
return;
type = arg_listtype(node->parent->parent->parent);
+ assert(-1 != type);
switch (type) {
case (MDOC_Diag):