Print this page
9718 update mandoc to 1.14.4

@@ -1,9 +1,9 @@
-/*      $Id: mdoc_term.c,v 1.364 2017/06/14 17:51:15 schwarze Exp $ */
+/*      $Id: mdoc_term.c,v 1.367 2018/04/11 17:11:13 schwarze Exp $ */
 /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012-2018 Ingo Schwarze <schwarze@openbsd.org>
  * Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
  * copyright notice and this permission notice appear in all copies.

@@ -281,11 +281,13 @@
                 save_defindent = p->defindent;
                 if (p->defindent == 0)
                         p->defindent = 5;
                 term_begin(p, print_mdoc_head, print_mdoc_foot,
                     &mdoc->meta);
-                while (n != NULL && n->flags & NODE_NOPRT)
+                while (n != NULL &&
+                    (n->type == ROFFT_COMMENT ||
+                     n->flags & NODE_NOPRT))
                         n = n->next;
                 if (n != NULL) {
                         if (n->tok != MDOC_Sh)
                                 term_vspace(p);
                         print_mdoc_nodelist(p, NULL, &mdoc->meta, n);

@@ -310,11 +312,11 @@
 {
         int              chld;
         struct termpair  npair;
         size_t           offset, rmargin;
 
-        if (n->flags & NODE_NOPRT)
+        if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT)
                 return;
 
         chld = 1;
         offset = p->tcol->offset;
         rmargin = p->tcol->rmargin;

@@ -565,11 +567,13 @@
                 return;
 
         /* Do not vspace directly after Ss/Sh. */
 
         nn = n;
-        while (nn->prev != NULL && nn->prev->flags & NODE_NOPRT)
+        while (nn->prev != NULL &&
+            (nn->prev->type == ROFFT_COMMENT ||
+             nn->prev->flags & NODE_NOPRT))
                 nn = nn->prev;
         while (nn->prev == NULL) {
                 do {
                         nn = nn->parent;
                         if (nn->type == ROFFT_ROOT)

@@ -1548,11 +1552,12 @@
 
         switch (n->type) {
         case ROFFT_BLOCK:
                 term_newln(p);
                 for (nn = n->prev; nn != NULL; nn = nn->prev)
-                        if ((nn->flags & NODE_NOPRT) == 0)
+                        if (nn->type != ROFFT_COMMENT &&
+                            (nn->flags & NODE_NOPRT) == 0)
                                 break;
                 if (nn != NULL)
                         term_vspace(p);
                 break;
         case ROFFT_HEAD:

@@ -1662,11 +1667,11 @@
                 break;
         case MDOC__T:
                 /* FALLTHROUGH */
         case MDOC_Do:
         case MDOC_Dq:
-                term_word(p, "\\(Lq");
+                term_word(p, "\\(lq");
                 break;
         case MDOC_En:
                 if (NULL == n->norm->Es ||
                     NULL == n->norm->Es->child)
                         return 1;

@@ -1720,11 +1725,11 @@
                 break;
         case MDOC__T:
                 /* FALLTHROUGH */
         case MDOC_Do:
         case MDOC_Dq:
-                term_word(p, "\\(Rq");
+                term_word(p, "\\(rq");
                 break;
         case MDOC_En:
                 if (n->norm->Es == NULL ||
                     n->norm->Es->child == NULL ||
                     n->norm->Es->child->next == NULL)

@@ -1938,11 +1943,10 @@
 
 static int
 termp_lk_pre(DECL_ARGS)
 {
         const struct roff_node *link, *descr, *punct;
-        int display;
 
         if ((link = n->child) == NULL)
                 return 0;
 
         /* Find beginning of trailing punctuation. */

@@ -1964,15 +1968,10 @@
                 p->flags |= TERMP_NOSPACE;
                 term_word(p, ":");
         }
 
         /* Link target. */
-        display = term_strlen(p, link->string) >= 26;
-        if (display) {
-                term_newln(p);
-                p->tcol->offset += term_len(p, p->defindent + 1);
-        }
         term_fontpush(p, TERMFONT_BOLD);
         term_word(p, link->string);
         term_fontpop(p);
 
         /* Trailing punctuation. */

@@ -1979,12 +1978,10 @@
         while (punct != NULL) {
                 p->flags |= TERMP_NOSPACE;
                 term_word(p, punct->string);
                 punct = punct->next;
         }
-        if (display)
-                term_newln(p);
         return 0;
 }
 
 static int
 termp_bk_pre(DECL_ARGS)