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

Diff for /mandoc/tbl_html.c between version 1.25 and 1.28

version 1.25, 2018/11/24 23:03:18 version 1.28, 2018/11/26 01:51:46
Line 101  print_tblclose(struct html *h)
Line 101  print_tblclose(struct html *h)
 void  void
 print_tbl(struct html *h, const struct tbl_span *sp)  print_tbl(struct html *h, const struct tbl_span *sp)
 {  {
         const struct tbl_dat *dp;          const struct tbl_dat    *dp;
         struct tag      *tt;          struct tag              *tt;
         const char      *halign, *valign;          const char              *hspans, *vspans, *halign, *valign;
         int              ic;          char                     hbuf[4], vbuf[4];
   
         /* Inhibit printing of spaces: we do padding ourselves. */          /* Inhibit printing of spaces: we do padding ourselves. */
   
Line 124  print_tbl(struct html *h, const struct tbl_span *sp)
Line 124  print_tbl(struct html *h, const struct tbl_span *sp)
                 print_otag(h, TAG_TD, "?", "colspan", "0");                  print_otag(h, TAG_TD, "?", "colspan", "0");
                 break;                  break;
         default:          default:
                 dp = sp->first;                  for (dp = sp->first; dp != NULL; dp = dp->next) {
                 for (ic = 0; ic < sp->opts->cols; ic++) {  
                         print_stagq(h, tt);                          print_stagq(h, tt);
                         if (dp == NULL || dp->layout->col > ic) {  
                                 print_otag(h, TAG_TD, "");                          /*
                            * Do not generate <td> elements for continuations
                            * of spanned cells.  Larger <td> elements covering
                            * this space were already generated earlier.
                            */
   
                           if (dp->layout->pos == TBL_CELL_SPAN ||
                               dp->layout->pos == TBL_CELL_DOWN ||
                               (dp->string != NULL &&
                                strcmp(dp->string, "\\^") == 0))
                                 continue;                                  continue;
                         }  
                           /* Determine the attribute values. */
   
                           if (dp->hspans > 0) {
                                   (void)snprintf(hbuf, sizeof(hbuf),
                                       "%d", dp->hspans + 1);
                                   hspans = hbuf;
                           } else
                                   hspans = NULL;
                           if (dp->vspans > 0) {
                                   (void)snprintf(vbuf, sizeof(vbuf),
                                       "%d", dp->vspans + 1);
                                   vspans = vbuf;
                           } else
                                   vspans = NULL;
   
                         switch (dp->layout->pos) {                          switch (dp->layout->pos) {
                         case TBL_CELL_CENTRE:                          case TBL_CELL_CENTRE:
                                 halign = "center";                                  halign = "center";
Line 149  print_tbl(struct html *h, const struct tbl_span *sp)
Line 172  print_tbl(struct html *h, const struct tbl_span *sp)
                                 valign = "bottom";                                  valign = "bottom";
                         else                          else
                                 valign = NULL;                                  valign = NULL;
                         if (halign == NULL && valign == NULL)  
                                 print_otag(h, TAG_TD, "");                          /* Print the element and the attributes. */
                         else if (halign == NULL)  
                                 print_otag(h, TAG_TD, "s",                          print_otag(h, TAG_TD, "??ss",
                                     "vertical-align", valign);                              "colspan", hspans, "rowspan", vspans,
                         else if (valign == NULL)                              "vertical-align", valign,
                                 print_otag(h, TAG_TD, "s",                              "text-align", halign);
                                     "text-align", halign);                          if (dp->string != NULL)
                         else                                  print_text(h, dp->string);
                                 print_otag(h, TAG_TD, "ss",  
                                     "vertical-align", valign,  
                                     "text-align", halign);  
                         if (dp->layout->pos != TBL_CELL_DOWN)  
                                 if (dp->string != NULL)  
                                         print_text(h, dp->string);  
                         dp = dp->next;  
                 }                  }
                 break;                  break;
         }          }

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.28

CVSweb