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

Diff for /mandoc/man_html.c between version 1.166 and 1.170

version 1.166, 2019/01/06 04:55:09 version 1.170, 2019/01/18 14:36:21
Line 119  html_man(void *arg, const struct roff_meta *man)
Line 119  html_man(void *arg, const struct roff_meta *man)
         if ((h->oflags & HTML_FRAGMENT) == 0) {          if ((h->oflags & HTML_FRAGMENT) == 0) {
                 print_gen_decls(h);                  print_gen_decls(h);
                 print_otag(h, TAG_HTML, "");                  print_otag(h, TAG_HTML, "");
                 if (n->type == ROFFT_COMMENT)                  if (n != NULL && n->type == ROFFT_COMMENT)
                         print_gen_comment(h, n);                          print_gen_comment(h, n);
                 t = print_otag(h, TAG_HEAD, "");                  t = print_otag(h, TAG_HEAD, "");
                 print_man_head(man, h);                  print_man_head(man, h);
Line 162  print_man_node(MAN_ARGS)
Line 162  print_man_node(MAN_ARGS)
         struct tag      *t;          struct tag      *t;
         int              child;          int              child;
   
           if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT)
                   return;
   
         html_fillmode(h, n->flags & NODE_NOFILL ? ROFF_nf : ROFF_fi);          html_fillmode(h, n->flags & NODE_NOFILL ? ROFF_nf : ROFF_fi);
   
         child = 1;          child = 1;
Line 171  print_man_node(MAN_ARGS)
Line 174  print_man_node(MAN_ARGS)
                         print_endline(h);                          print_endline(h);
                         return;                          return;
                 }                  }
                 t = h->tag;  
                 if (*n->string == ' ' && n->flags & NODE_LINE &&                  if (*n->string == ' ' && n->flags & NODE_LINE &&
                     (h->flags & HTML_NONEWLINE) == 0)                      (h->flags & HTML_NONEWLINE) == 0)
                         print_endline(h);                          print_endline(h);
                 else if (n->flags & NODE_DELIMC)                  else if (n->flags & NODE_DELIMC)
                         h->flags |= HTML_NOSPACE;                          h->flags |= HTML_NOSPACE;
                   t = h->tag;
                   t->refcnt++;
                 print_text(h, n->string);                  print_text(h, n->string);
                 break;                  break;
         case ROFFT_COMMENT:  
                 return;  
         case ROFFT_EQN:          case ROFFT_EQN:
                 t = h->tag;                  t = h->tag;
                   t->refcnt++;
                 print_eqn(h, n->eqn);                  print_eqn(h, n->eqn);
                 break;                  break;
         case ROFFT_TBL:          case ROFFT_TBL:
Line 210  print_man_node(MAN_ARGS)
Line 213  print_man_node(MAN_ARGS)
                  */                   */
                 if (h->tblt != NULL)                  if (h->tblt != NULL)
                         print_tblclose(h);                          print_tblclose(h);
   
                 t = h->tag;                  t = h->tag;
                   t->refcnt++;
                 if (n->tok < ROFF_MAX) {                  if (n->tok < ROFF_MAX) {
                         roff_html_pre(h, n);                          roff_html_pre(h, n);
                         if (n->tok != ROFF_sp)                          t->refcnt--;
                                 print_stagq(h, t);                          print_stagq(h, t);
                         return;                          return;
                 }                  }
   
                 assert(n->tok >= MAN_TH && n->tok < MAN_MAX);                  assert(n->tok >= MAN_TH && n->tok < MAN_MAX);
                 if (man_html_acts[n->tok - MAN_TH].pre != NULL)                  if (man_html_acts[n->tok - MAN_TH].pre != NULL)
                         child = (*man_html_acts[n->tok - MAN_TH].pre)(man,                          child = (*man_html_acts[n->tok - MAN_TH].pre)(man,
Line 230  print_man_node(MAN_ARGS)
Line 232  print_man_node(MAN_ARGS)
                 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. */
           t->refcnt--;
         print_stagq(h, t);          print_stagq(h, t);
   
         if (n->flags & NODE_NOFILL && n->tok != MAN_YS &&          if (n->flags & NODE_NOFILL && n->tok != MAN_YS &&
Line 298  man_SH_pre(MAN_ARGS)
Line 301  man_SH_pre(MAN_ARGS)
         case ROFFT_HEAD:          case ROFFT_HEAD:
                 id = html_make_id(n, 1);                  id = html_make_id(n, 1);
                 if (n->tok == MAN_SH)                  if (n->tok == MAN_SH)
                         print_otag(h, TAG_H1, "cTi", "Sh", id);                          print_otag(h, TAG_H1, "ci", "Sh", id);
                 else                  else
                         print_otag(h, TAG_H2, "cTi", "Ss", id);                          print_otag(h, TAG_H2, "ci", "Ss", id);
                 if (id != NULL)                  if (id != NULL)
                         print_otag(h, TAG_A, "chR", "permalink", id);                          print_otag(h, TAG_A, "chR", "permalink", id);
                 break;                  break;
Line 512  man_SY_pre(MAN_ARGS)
Line 515  man_SY_pre(MAN_ARGS)
                 break;                  break;
         case ROFFT_HEAD:          case ROFFT_HEAD:
                 print_otag(h, TAG_TD, "");                  print_otag(h, TAG_TD, "");
                 print_otag(h, TAG_CODE, "cT", "Nm");                  print_otag(h, TAG_CODE, "c", "Nm");
                 break;                  break;
         case ROFFT_BODY:          case ROFFT_BODY:
                 print_otag(h, TAG_TD, "");                  print_otag(h, TAG_TD, "");
Line 534  man_UR_pre(MAN_ARGS)
Line 537  man_UR_pre(MAN_ARGS)
                 assert(n->child->type == ROFFT_TEXT);                  assert(n->child->type == ROFFT_TEXT);
                 if (n->tok == MAN_MT) {                  if (n->tok == MAN_MT) {
                         mandoc_asprintf(&cp, "mailto:%s", n->child->string);                          mandoc_asprintf(&cp, "mailto:%s", n->child->string);
                         print_otag(h, TAG_A, "cTh", "Mt", cp);                          print_otag(h, TAG_A, "ch", "Mt", cp);
                         free(cp);                          free(cp);
                 } else                  } else
                         print_otag(h, TAG_A, "cTh", "Lk", n->child->string);                          print_otag(h, TAG_A, "ch", "Lk", n->child->string);
         }          }
   
         assert(n->next->type == ROFFT_BODY);          assert(n->next->type == ROFFT_BODY);

Legend:
Removed from v.1.166  
changed lines
  Added in v.1.170

CVSweb