[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.38 and 1.39

version 1.38, 2009/07/13 07:23:07 version 1.39, 2009/07/14 15:17:25
Line 700  termp_it_pre(DECL_ARGS)
Line 700  termp_it_pre(DECL_ARGS)
 {  {
         const struct mdoc_node *bl, *n;          const struct mdoc_node *bl, *n;
         char                    buf[7];          char                    buf[7];
         int                     i, type, keys[3], vals[3], sv;          int                     i, type, keys[3], vals[3];
         size_t                  width, offset;          size_t                  width, offset;
   
         if (MDOC_BLOCK == node->type)          if (MDOC_BLOCK == node->type)
Line 769  termp_it_pre(DECL_ARGS)
Line 769  termp_it_pre(DECL_ARGS)
                         width = 5;                          width = 5;
                 break;                  break;
         case (MDOC_Hang):          case (MDOC_Hang):
                 /* FALLTHROUGH */                  if (0 == width)
                           width = 8;
                   break;
         case (MDOC_Tag):          case (MDOC_Tag):
                 if (0 == width)                  if (0 == width)
                         width = 10;                          width = 10;
Line 787  termp_it_pre(DECL_ARGS)
Line 789  termp_it_pre(DECL_ARGS)
         case (MDOC_Diag):          case (MDOC_Diag):
                 term_word(p, "\\ ");                  term_word(p, "\\ ");
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case (MDOC_Hang):  
                 /* FALLTHROUGH */  
         case (MDOC_Inset):          case (MDOC_Inset):
                 if (MDOC_BODY == node->type)                  if (MDOC_BODY == node->type)
                         p->flags &= ~TERMP_NOSPACE;                          p->flags &= ~TERMP_NOSPACE;
Line 829  termp_it_pre(DECL_ARGS)
Line 829  termp_it_pre(DECL_ARGS)
         case (MDOC_Enum):          case (MDOC_Enum):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case (MDOC_Hyphen):          case (MDOC_Hyphen):
                 /* FALLTHROUGH */                  if (MDOC_HEAD == node->type)
                           p->flags |= TERMP_NOBREAK;
                   else
                           p->flags |= TERMP_NOLPAD;
                   break;
         case (MDOC_Hang):          case (MDOC_Hang):
                 /* FALLTHROUGH */                  if (MDOC_HEAD == node->type)
                           p->flags |= TERMP_NOBREAK;
                   else
                           p->flags |= TERMP_NOLPAD;
   
                   if (MDOC_HEAD == node->type)
                           p->flags |= TERMP_HANG;
                   break;
         case (MDOC_Tag):          case (MDOC_Tag):
                 if (MDOC_HEAD == node->type)                  if (MDOC_HEAD == node->type)
                         p->flags |= TERMP_NOBREAK;                          p->flags |= TERMP_NOBREAK;
                 else                  else
                         p->flags |= TERMP_NOLPAD;                          p->flags |= TERMP_NOLPAD;
   
                 if (MDOC_HEAD == node->type && MDOC_Hang == type)                  if (MDOC_HEAD != node->type)
                         p->flags |= TERMP_NONOBREAK;                          break;
                   if (NULL == node->next || NULL == node->next->child)
                 if (MDOC_HEAD == node->type && MDOC_Tag == type)                          p->flags |= TERMP_DANGLE;
                         if (NULL == node->next ||  
                                         NULL == node->next->child)  
                                 p->flags |= TERMP_NONOBREAK;  
                 break;                  break;
         case (MDOC_Column):          case (MDOC_Column):
                 if (MDOC_HEAD == node->type) {                  if (MDOC_HEAD == node->type) {
Line 902  termp_it_pre(DECL_ARGS)
Line 910  termp_it_pre(DECL_ARGS)
          * HEAD character (temporarily bold, in some cases).           * HEAD character (temporarily bold, in some cases).
          */           */
   
         sv = p->flags;  
         if (MDOC_HEAD == node->type)          if (MDOC_HEAD == node->type)
                 switch (type) {                  switch (type) {
                 case (MDOC_Bullet):                  case (MDOC_Bullet):
                         p->flags |= TERMP_BOLD;                          p->flags |= TERMP_BOLD;
                         term_word(p, "\\[bu]");                          term_word(p, "\\[bu]");
                           p->flags &= ~TERMP_BOLD;
                         break;                          break;
                 case (MDOC_Dash):                  case (MDOC_Dash):
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case (MDOC_Hyphen):                  case (MDOC_Hyphen):
                         p->flags |= TERMP_BOLD;                          p->flags |= TERMP_BOLD;
                         term_word(p, "\\(hy");                          term_word(p, "\\(hy");
                           p->flags &= ~TERMP_BOLD;
                         break;                          break;
                 case (MDOC_Enum):                  case (MDOC_Enum):
                         (pair->ppair->ppair->count)++;                          (pair->ppair->ppair->count)++;
Line 924  termp_it_pre(DECL_ARGS)
Line 933  termp_it_pre(DECL_ARGS)
                 default:                  default:
                         break;                          break;
                 }                  }
   
         p->flags = sv; /* Restore saved flags. */  
   
         /*          /*
          * If we're not going to process our children, indicate so here.           * If we're not going to process our children, indicate so here.

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

CVSweb