[BACK]Return to man_html.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/man_html.c between version 1.116 and 1.117

version 1.116, 2019/01/05 09:14:11 version 1.117, 2019/01/05 09:46:26
Line 31 
Line 31 
 #include "html.h"  #include "html.h"
 #include "main.h"  #include "main.h"
   
 /* FIXME: have PD set the default vspace width. */  
   
 #define MAN_ARGS          const struct roff_meta *man, \  #define MAN_ARGS          const struct roff_meta *man, \
                           const struct roff_node *n, \                            const struct roff_node *n, \
                           struct html *h                            struct html *h
Line 121 
Line 119 
 static void  static void
 print_bvspace(struct html *h, const struct roff_node *n)  print_bvspace(struct html *h, const struct roff_node *n)
 {  {
           if (n->body != NULL && n->body->child != NULL &&
               n->body->child->type == ROFFT_TBL)
                   return;
   
         if (n->body && n->body->child)          if (n->prev == NULL && n->parent->tok != MAN_RS)
                 if (n->body->child->type == ROFFT_TBL)                  return;
                         return;  
   
         if (n->parent->type == ROFFT_ROOT || n->parent->tok != MAN_RS)  
                 if (NULL == n->prev)  
                         return;  
   
         print_paragraph(h);          print_paragraph(h);
 }  }
   
Line 177 
Line 173 
 static void  static void
 print_man_nodelist(MAN_ARGS)  print_man_nodelist(MAN_ARGS)
 {  {
   
         while (n != NULL) {          while (n != NULL) {
                 print_man_node(man, n, h);                  print_man_node(man, n, h);
                 n = n->next;                  n = n->next;
Line 236 
Line 231 
                  * the "meta" table state.  This will be reopened on the                   * the "meta" table state.  This will be reopened on the
                  * next table element.                   * next table element.
                  */                   */
                 if (h->tblt)                  if (h->tblt != NULL)
                         print_tblclose(h);                          print_tblclose(h);
   
                 t = h->tag;                  t = h->tag;
Line 253 
Line 248 
                 break;                  break;
         }          }
   
         if (child && n->child)          if (child && n->child != NULL)
                 print_man_nodelist(man, n->child, h);                  print_man_nodelist(man, n->child, h);
   
         /* This will automatically close out any font scope. */          /* This will automatically close out any font scope. */
Line 285 
Line 280 
         print_stagq(h, tt);          print_stagq(h, tt);
   
         print_otag(h, TAG_TD, "c", "head-vol");          print_otag(h, TAG_TD, "c", "head-vol");
         if (NULL != man->vol)          if (man->vol != NULL)
                 print_text(h, man->vol);                  print_text(h, man->vol);
         print_stagq(h, tt);          print_stagq(h, tt);
   
Line 308 
Line 303 
         print_stagq(h, tt);          print_stagq(h, tt);
   
         print_otag(h, TAG_TD, "c", "foot-os");          print_otag(h, TAG_TD, "c", "foot-os");
         if (man->os)          if (man->os != NULL)
                 print_text(h, man->os);                  print_text(h, man->os);
         print_tagq(h, t);          print_tagq(h, t);
 }  }
Line 331 
Line 326 
 man_alt_pre(MAN_ARGS)  man_alt_pre(MAN_ARGS)
 {  {
         const struct roff_node  *nn;          const struct roff_node  *nn;
           struct tag      *t;
         int              i;          int              i;
         enum htmltag     fp;          enum htmltag     fp;
         struct tag      *t;  
   
         for (i = 0, nn = n->child; nn; nn = nn->next, i++) {          for (i = 0, nn = n->child; nn != NULL; nn = nn->next, i++) {
                 switch (n->tok) {                  switch (n->tok) {
                 case MAN_BI:                  case MAN_BI:
                         fp = i % 2 ? TAG_I : TAG_B;                          fp = i % 2 ? TAG_I : TAG_B;
Line 377 
Line 372 
 man_SM_pre(MAN_ARGS)  man_SM_pre(MAN_ARGS)
 {  {
         print_otag(h, TAG_SMALL, "");          print_otag(h, TAG_SMALL, "");
         if (MAN_SB == n->tok)          if (n->tok == MAN_SB)
                 print_otag(h, TAG_B, "");                  print_otag(h, TAG_B, "");
         return 1;          return 1;
 }  }
Line 399 
Line 394 
 static int  static int
 man_PP_pre(MAN_ARGS)  man_PP_pre(MAN_ARGS)
 {  {
   
         if (n->type == ROFFT_HEAD)          if (n->type == ROFFT_HEAD)
                 return 0;                  return 0;
         else if (n->type == ROFFT_BLOCK)          else if (n->type == ROFFT_BLOCK)
Line 441 
Line 435 
         default:          default:
                 abort();                  abort();
         }          }
   
         return 0;          return 0;
 }  }
   
Line 467 
Line 460 
         h->flags |= HTML_NOSPACE;          h->flags |= HTML_NOSPACE;
         tt = print_otag(h, TAG_SPAN, "c", "Op");          tt = print_otag(h, TAG_SPAN, "c", "Op");
   
         if (NULL != (n = n->child)) {          if ((n = n->child) != NULL) {
                 print_otag(h, TAG_B, "");                  print_otag(h, TAG_B, "");
                 print_text(h, n->string);                  print_text(h, n->string);
         }          }
   
         print_stagq(h, tt);          print_stagq(h, tt);
   
         if (NULL != n && NULL != n->next) {          if (n != NULL && n->next != NULL) {
                 print_otag(h, TAG_I, "");                  print_otag(h, TAG_I, "");
                 print_text(h, n->next->string);                  print_text(h, n->next->string);
         }          }
Line 509 
Line 502 
 static int  static int
 man_ign_pre(MAN_ARGS)  man_ign_pre(MAN_ARGS)
 {  {
   
         return 0;          return 0;
 }  }
   
Line 548 
Line 540 
 man_UR_pre(MAN_ARGS)  man_UR_pre(MAN_ARGS)
 {  {
         char *cp;          char *cp;
   
         n = n->child;          n = n->child;
         assert(n->type == ROFFT_HEAD);          assert(n->type == ROFFT_HEAD);
         if (n->child != NULL) {          if (n->child != NULL) {
Line 565 
Line 558 
                 n = n->next;                  n = n->next;
   
         print_man_nodelist(man, n->child, h);          print_man_nodelist(man, n->child, h);
   
         return 0;          return 0;
 }  }
   

Legend:
Removed from v.1.116  
changed lines
  Added in v.1.117