[BACK]Return to mdoc_term.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/mdoc_term.c between version 1.363 and 1.367

version 1.363, 2017/06/08 12:54:58 version 1.367, 2018/04/11 17:11:13
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>   * 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>   * Copyright (c) 2013 Franco Fichtner <franco@lastsummer.de>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
Line 283  terminal_mdoc(void *arg, const struct roff_man *mdoc)
Line 283  terminal_mdoc(void *arg, const struct roff_man *mdoc)
                         p->defindent = 5;                          p->defindent = 5;
                 term_begin(p, print_mdoc_head, print_mdoc_foot,                  term_begin(p, print_mdoc_head, print_mdoc_foot,
                     &mdoc->meta);                      &mdoc->meta);
                 while (n != NULL && n->flags & NODE_NOPRT)                  while (n != NULL &&
                       (n->type == ROFFT_COMMENT ||
                        n->flags & NODE_NOPRT))
                         n = n->next;                          n = n->next;
                 if (n != NULL) {                  if (n != NULL) {
                         if (n->tok != MDOC_Sh)                          if (n->tok != MDOC_Sh)
Line 312  print_mdoc_node(DECL_ARGS)
Line 314  print_mdoc_node(DECL_ARGS)
         struct termpair  npair;          struct termpair  npair;
         size_t           offset, rmargin;          size_t           offset, rmargin;
   
         if (n->flags & NODE_NOPRT)          if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT)
                 return;                  return;
   
         chld = 1;          chld = 1;
Line 540  a2width(const struct termp *p, const char *v)
Line 542  a2width(const struct termp *p, const char *v)
                 SCALE_HS_INIT(&su, term_strlen(p, v));                  SCALE_HS_INIT(&su, term_strlen(p, v));
                 su.scale /= term_strlen(p, "0");                  su.scale /= term_strlen(p, "0");
         }          }
         return term_hspan(p, &su) / 24;          return term_hen(p, &su);
 }  }
   
 /*  /*
Line 567  print_bvspace(struct termp *p,
Line 569  print_bvspace(struct termp *p,
         /* Do not vspace directly after Ss/Sh. */          /* Do not vspace directly after Ss/Sh. */
   
         nn = n;          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;                  nn = nn->prev;
         while (nn->prev == NULL) {          while (nn->prev == NULL) {
                 do {                  do {
Line 686  termp_it_pre(DECL_ARGS)
Line 690  termp_it_pre(DECL_ARGS)
                         SCALE_HS_INIT(&su,                          SCALE_HS_INIT(&su,
                             term_strlen(p, bl->norm->Bl.cols[i]));                              term_strlen(p, bl->norm->Bl.cols[i]));
                         su.scale /= term_strlen(p, "0");                          su.scale /= term_strlen(p, "0");
                         offset += term_hspan(p, &su) / 24 + dcol;                          offset += term_hen(p, &su) + dcol;
                 }                  }
   
                 /*                  /*
Line 704  termp_it_pre(DECL_ARGS)
Line 708  termp_it_pre(DECL_ARGS)
                  */                   */
                 SCALE_HS_INIT(&su, term_strlen(p, bl->norm->Bl.cols[i]));                  SCALE_HS_INIT(&su, term_strlen(p, bl->norm->Bl.cols[i]));
                 su.scale /= term_strlen(p, "0");                  su.scale /= term_strlen(p, "0");
                 width = term_hspan(p, &su) / 24 + dcol;                  width = term_hen(p, &su) + dcol;
                 break;                  break;
         default:          default:
                 if (NULL == bl->norm->Bl.width)                  if (NULL == bl->norm->Bl.width)
Line 1550  termp_ss_pre(DECL_ARGS)
Line 1554  termp_ss_pre(DECL_ARGS)
         case ROFFT_BLOCK:          case ROFFT_BLOCK:
                 term_newln(p);                  term_newln(p);
                 for (nn = n->prev; nn != NULL; nn = nn->prev)                  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;                                  break;
                 if (nn != NULL)                  if (nn != NULL)
                         term_vspace(p);                          term_vspace(p);
Line 1664  termp_quote_pre(DECL_ARGS)
Line 1669  termp_quote_pre(DECL_ARGS)
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case MDOC_Do:          case MDOC_Do:
         case MDOC_Dq:          case MDOC_Dq:
                 term_word(p, "\\(Lq");                  term_word(p, "\\(lq");
                 break;                  break;
         case MDOC_En:          case MDOC_En:
                 if (NULL == n->norm->Es ||                  if (NULL == n->norm->Es ||
Line 1722  termp_quote_post(DECL_ARGS)
Line 1727  termp_quote_post(DECL_ARGS)
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case MDOC_Do:          case MDOC_Do:
         case MDOC_Dq:          case MDOC_Dq:
                 term_word(p, "\\(Rq");                  term_word(p, "\\(rq");
                 break;                  break;
         case MDOC_En:          case MDOC_En:
                 if (n->norm->Es == NULL ||                  if (n->norm->Es == NULL ||
Line 1940  static int
Line 1945  static int
 termp_lk_pre(DECL_ARGS)  termp_lk_pre(DECL_ARGS)
 {  {
         const struct roff_node *link, *descr, *punct;          const struct roff_node *link, *descr, *punct;
         int display;  
   
         if ((link = n->child) == NULL)          if ((link = n->child) == NULL)
                 return 0;                  return 0;
Line 1966  termp_lk_pre(DECL_ARGS)
Line 1970  termp_lk_pre(DECL_ARGS)
         }          }
   
         /* Link target. */          /* 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_fontpush(p, TERMFONT_BOLD);
         term_word(p, link->string);          term_word(p, link->string);
         term_fontpop(p);          term_fontpop(p);
Line 1981  termp_lk_pre(DECL_ARGS)
Line 1980  termp_lk_pre(DECL_ARGS)
                 term_word(p, punct->string);                  term_word(p, punct->string);
                 punct = punct->next;                  punct = punct->next;
         }          }
         if (display)  
                 term_newln(p);  
         return 0;          return 0;
 }  }
   

Legend:
Removed from v.1.363  
changed lines
  Added in v.1.367

CVSweb