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

Diff for /mandoc/mdoc_html.c between version 1.91 and 1.93

version 1.91, 2010/07/02 10:42:46 version 1.93, 2010/07/04 21:59:30
Line 1074  mdoc_it_head_pre(MDOC_ARGS, enum mdoc_list type, struc
Line 1074  mdoc_it_head_pre(MDOC_ARGS, enum mdoc_list type, struc
 static int  static int
 mdoc_it_pre(MDOC_ARGS)  mdoc_it_pre(MDOC_ARGS)
 {  {
         int                      i, wp, comp;          int                      i, comp;
         const struct mdoc_node  *bl, *nn;          const struct mdoc_node  *bl, *nn;
         struct roffsu            width, offs;          struct roffsu            width, offs;
         enum mdoc_list           type;          enum mdoc_list           type;
Line 1116  mdoc_it_pre(MDOC_ARGS)
Line 1116  mdoc_it_pre(MDOC_ARGS)
         if (bl->data.Bl->width)          if (bl->data.Bl->width)
                 a2width(bl->data.Bl->width, &width);                  a2width(bl->data.Bl->width, &width);
   
         wp = -1;  
         for (i = 0; bl->args && i < (int)bl->args->argc; i++)  
                 switch (bl->args->argv[i].arg) {  
                 case (MDOC_Column):  
                         wp = i; /* Save for later. */  
                         break;  
                 default:  
                         break;  
                 }  
   
         /* Override width in some cases. */          /* Override width in some cases. */
   
         switch (type) {          switch (type) {
Line 1149  mdoc_it_pre(MDOC_ARGS)
Line 1139  mdoc_it_pre(MDOC_ARGS)
                 for (i = 0; nn && nn != n; nn = nn->next)                  for (i = 0; nn && nn != n; nn = nn->next)
                         if (MDOC_BODY == nn->type)                          if (MDOC_BODY == nn->type)
                                 i++;                                  i++;
                 if (i < (int)bl->args->argv[wp].sz)                  if (i < (int)bl->data.Bl->ncols)
                         a2width(bl->args->argv[wp].value[i], &width);                          a2width(bl->data.Bl->cols[i], &width);
         }          }
   
         if (MDOC_HEAD == n->type)          if (MDOC_HEAD == n->type)
Line 2015  mdoc_ap_pre(MDOC_ARGS)
Line 2005  mdoc_ap_pre(MDOC_ARGS)
 static int  static int
 mdoc_bf_pre(MDOC_ARGS)  mdoc_bf_pre(MDOC_ARGS)
 {  {
         int              i;  
         struct htmlpair  tag[2];          struct htmlpair  tag[2];
         struct roffsu    su;          struct roffsu    su;
   
         if (MDOC_HEAD == n->type)          if (MDOC_HEAD == n->type)
                 return(0);                  return(0);
         else if (MDOC_BLOCK != n->type)          else if (MDOC_BODY != n->type)
                 return(1);                  return(1);
   
         PAIR_CLASS_INIT(&tag[0], "lit");          assert(n->data.Bf);
   
         if (n->head->child) {          if (FONT_Em == n->data.Bf->font)
                 if ( ! strcmp("Em", n->head->child->string))                  PAIR_CLASS_INIT(&tag[0], "emph");
                         PAIR_CLASS_INIT(&tag[0], "emph");          else if (FONT_Sy == n->data.Bf->font)
                 else if ( ! strcmp("Sy", n->head->child->string))                  PAIR_CLASS_INIT(&tag[0], "symb");
                         PAIR_CLASS_INIT(&tag[0], "symb");          else if (FONT_Li == n->data.Bf->font)
                 else if ( ! strcmp("Li", n->head->child->string))                  PAIR_CLASS_INIT(&tag[0], "lit");
                         PAIR_CLASS_INIT(&tag[0], "lit");          else
         } else {                  PAIR_CLASS_INIT(&tag[0], "none");
                 for (i = 0; n->args && i < (int)n->args->argc; i++)  
                         switch (n->args->argv[i].arg) {  
                         case (MDOC_Symbolic):  
                                 PAIR_CLASS_INIT(&tag[0], "symb");  
                                 break;  
                         case (MDOC_Literal):  
                                 PAIR_CLASS_INIT(&tag[0], "lit");  
                                 break;  
                         case (MDOC_Emphasis):  
                                 PAIR_CLASS_INIT(&tag[0], "emph");  
                                 break;  
                         default:  
                                 break;  
                         }  
         }  
   
         /* FIXME: div's have spaces stripped--we want them. */          /*
            * We want this to be inline-formatted, but needs to be div to
            * accept block children.
            */
         bufcat_style(h, "display", "inline");          bufcat_style(h, "display", "inline");
         SCALE_HS_INIT(&su, 1);          SCALE_HS_INIT(&su, 1);
         bufcat_su(h, "margin-right", &su);          /* Needs a left-margin for spacing. */
           bufcat_su(h, "margin-left", &su);
         PAIR_STYLE_INIT(&tag[1], h);          PAIR_STYLE_INIT(&tag[1], h);
         print_otag(h, TAG_DIV, 2, tag);          print_otag(h, TAG_DIV, 2, tag);
         return(1);          return(1);

Legend:
Removed from v.1.91  
changed lines
  Added in v.1.93

CVSweb