[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.123 and 1.124

version 1.123, 2010/12/17 00:18:29 version 1.124, 2010/12/17 01:02:00
Line 644  mdoc_nd_pre(MDOC_ARGS)
Line 644  mdoc_nd_pre(MDOC_ARGS)
         /* XXX: this tag in theory can contain block elements. */          /* XXX: this tag in theory can contain block elements. */
   
         print_text(h, "\\(em");          print_text(h, "\\(em");
         PAIR_CLASS_INIT(&tag, "desc-body");          PAIR_CLASS_INIT(&tag, "desc");
         print_otag(h, TAG_SPAN, 1, &tag);          print_otag(h, TAG_SPAN, 1, &tag);
         return(1);          return(1);
 }  }
Line 655  mdoc_nm_pre(MDOC_ARGS)
Line 655  mdoc_nm_pre(MDOC_ARGS)
 {  {
         struct htmlpair  tag;          struct htmlpair  tag;
         struct roffsu    su;          struct roffsu    su;
         const char      *cp;          size_t           len;
   
         /*          switch (n->type) {
          * Accomodate for `Nm' being both an element (which may have          case (MDOC_ELEM):
          * NULL children AND no m->name) and a block.  
          */  
   
         cp = NULL;  
   
         if (MDOC_ELEM == n->type) {  
                 if (NULL == n->child && NULL == m->name)  
                         return(1);  
                 synopsis_pre(h, n);                  synopsis_pre(h, n);
                 PAIR_CLASS_INIT(&tag, "name");                  PAIR_CLASS_INIT(&tag, "name");
                 print_otag(h, TAG_SPAN, 1, &tag);                  print_otag(h, TAG_SPAN, 1, &tag);
                 if (NULL == n->child)                  if (NULL == n->child && m->name)
                         print_text(h, m->name);                          print_text(h, m->name);
         } else if (MDOC_BLOCK == n->type) {                  return(1);
                 synopsis_pre(h, n);          case (MDOC_HEAD):
                   print_otag(h, TAG_TD, 0, NULL);
                   if (NULL == n->child && m->name)
                           print_text(h, m->name);
                   return(1);
           case (MDOC_BODY):
                   print_otag(h, TAG_TD, 0, NULL);
                   return(1);
           default:
                   break;
           }
   
                 bufcat_style(h, "clear", "both");          synopsis_pre(h, n);
                 if (n->head->child || m->name) {          PAIR_CLASS_INIT(&tag, "synopsis");
                         if (n->head->child && MDOC_TEXT ==          print_otag(h, TAG_TABLE, 1, &tag);
                                         n->head->child->type)  
                                 cp = n->head->child->string;  
                         if (NULL == cp || '\0' == *cp)  
                                 cp = m->name;  
   
                         SCALE_HS_INIT(&su, (double)strlen(cp));          for (len = 0, n = n->child; n; n = n->next)
                         bufcat_su(h, "padding-left", &su);                  if (MDOC_TEXT == n->type)
                 }                          len += strlen(n->string);
   
                 PAIR_STYLE_INIT(&tag, h);          if (0 == len && m->name)
                 print_otag(h, TAG_DIV, 1, &tag);                  len = strlen(m->name);
         } else if (MDOC_HEAD == n->type) {  
                 if (NULL == n->child && NULL == m->name)  
                         return(1);  
   
                 if (n->child && MDOC_TEXT == n->child->type)          SCALE_HS_INIT(&su, (double)len);
                         cp = n->child->string;          bufcat_su(h, "width", &su);
                 if (NULL == cp || '\0' == *cp)          PAIR_STYLE_INIT(&tag, h);
                         cp = m->name;          print_otag(h, TAG_COL, 1, &tag);
           print_otag(h, TAG_COL, 0, NULL);
                 SCALE_HS_INIT(&su, (double)strlen(cp));          print_otag(h, TAG_TBODY, 0, NULL);
           print_otag(h, TAG_TR, 0, NULL);
                 bufcat_style(h, "float", "left");  
                 bufcat_su(h, "min-width", &su);  
                 SCALE_INVERT(&su);  
                 bufcat_su(h, "margin-left", &su);  
   
                 PAIR_STYLE_INIT(&tag, h);  
                 print_otag(h, TAG_DIV, 1, &tag);  
   
                 if (NULL == n->child)  
                         print_text(h, m->name);  
         } else if (MDOC_BODY == n->type) {  
                 SCALE_HS_INIT(&su, 2);  
                 bufcat_su(h, "margin-left", &su);  
                 PAIR_STYLE_INIT(&tag, h);  
                 print_otag(h, TAG_DIV, 1, &tag);  
         }  
   
         return(1);          return(1);
 }  }
   

Legend:
Removed from v.1.123  
changed lines
  Added in v.1.124

CVSweb