[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.362 and 1.365

version 1.362, 2017/06/07 17:38:26 version 1.365, 2018/01/13 05:23:18
Line 533  static int
Line 533  static int
 a2width(const struct termp *p, const char *v)  a2width(const struct termp *p, const char *v)
 {  {
         struct roffsu    su;          struct roffsu    su;
           const char      *end;
   
         if (a2roffsu(v, &su, SCALE_MAX) < 2) {          end = a2roffsu(v, &su, SCALE_MAX);
           if (end == NULL || *end != '\0') {
                 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 684  termp_it_pre(DECL_ARGS)
Line 686  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 702  termp_it_pre(DECL_ARGS)
Line 704  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 1938  static int
Line 1940  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 1964  termp_lk_pre(DECL_ARGS)
Line 1965  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 1979  termp_lk_pre(DECL_ARGS)
Line 1975  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.362  
changed lines
  Added in v.1.365

CVSweb