]> git.cameronkatri.com Git - mandoc.git/blobdiff - mdoc_term.c
Removed TODO that was fixed by parsing escapes in offset strings.
[mandoc.git] / mdoc_term.c
index ca865c4f2ce070de9489b2fdb84b3ff72aa42618..c2ba9eaf758573ef3bb32ec8d04b5773b8ca5fc8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $Id: mdoc_term.c,v 1.184 2010/09/04 19:01:52 kristaps Exp $ */
+/*     $Id: mdoc_term.c,v 1.185 2010/09/23 20:40:00 schwarze Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -1031,12 +1031,18 @@ termp_nm_pre(DECL_ARGS)
                synopsis_pre(p, n->parent);
 
        if (MDOC_HEAD == n->type && n->next->child) {
-               p->flags |= TERMP_NOSPACE | TERMP_NOBREAK | TERMP_HANG;
-               p->rmargin = p->offset + term_len(p, 1) +
-                   (NULL == n->child ? term_strlen(p, m->name) :
-                    MDOC_TEXT == n->child->type ?
-                       term_strlen(p, n->child->string) :
-                    term_len(p, 5));
+               p->flags |= TERMP_NOSPACE | TERMP_NOBREAK;
+               p->rmargin = p->offset + term_len(p, 1);
+               if (NULL == n->child) {
+                       p->rmargin += term_strlen(p, m->name);
+               } else if (MDOC_TEXT == n->child->type) {
+                       p->rmargin += term_strlen(p, n->child->string);
+                       if (n->child->next)
+                               p->flags |= TERMP_HANG;
+               } else {
+                       p->rmargin += term_len(p, 5);
+                       p->flags |= TERMP_HANG;
+               }
        }
 
        term_fontpush(p, TERMFONT_BOLD);