[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.299 and 1.304

version 1.299, 2018/05/08 21:42:34 version 1.304, 2018/05/25 20:23:51
Line 502  cond_id(const struct roff_node *n)
Line 502  cond_id(const struct roff_node *n)
              (n->parent->tok == MDOC_Xo &&               (n->parent->tok == MDOC_Xo &&
               n->parent->parent->prev == NULL &&                n->parent->parent->prev == NULL &&
               n->parent->parent->parent->tok == MDOC_It)))                n->parent->parent->parent->tok == MDOC_It)))
                 return html_make_id(n);                  return html_make_id(n, 1);
         return NULL;          return NULL;
 }  }
   
Line 513  mdoc_sh_pre(MDOC_ARGS)
Line 513  mdoc_sh_pre(MDOC_ARGS)
   
         switch (n->type) {          switch (n->type) {
         case ROFFT_HEAD:          case ROFFT_HEAD:
                 id = html_make_id(n);                  id = html_make_id(n, 1);
                 print_otag(h, TAG_H1, "cTi", "Sh", id);                  print_otag(h, TAG_H1, "cTi", "Sh", id);
                 if (id != NULL)                  if (id != NULL)
                         print_otag(h, TAG_A, "chR", "permalink", id);                          print_otag(h, TAG_A, "chR", "permalink", id);
                 free(id);  
                 break;                  break;
         case ROFFT_BODY:          case ROFFT_BODY:
                 if (n->sec == SEC_AUTHORS)                  if (n->sec == SEC_AUTHORS)
Line 537  mdoc_ss_pre(MDOC_ARGS)
Line 536  mdoc_ss_pre(MDOC_ARGS)
         if (n->type != ROFFT_HEAD)          if (n->type != ROFFT_HEAD)
                 return 1;                  return 1;
   
         id = html_make_id(n);          id = html_make_id(n, 1);
         print_otag(h, TAG_H2, "cTi", "Ss", id);          print_otag(h, TAG_H2, "cTi", "Ss", id);
         if (id != NULL)          if (id != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         free(id);  
         return 1;          return 1;
 }  }
   
Line 553  mdoc_fl_pre(MDOC_ARGS)
Line 551  mdoc_fl_pre(MDOC_ARGS)
         if ((id = cond_id(n)) != NULL)          if ((id = cond_id(n)) != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         print_otag(h, TAG_CODE, "cTi", "Fl", id);          print_otag(h, TAG_CODE, "cTi", "Fl", id);
         free(id);  
   
         print_text(h, "\\-");          print_text(h, "\\-");
         if (!(n->child == NULL &&          if (!(n->child == NULL &&
Line 573  mdoc_cm_pre(MDOC_ARGS)
Line 570  mdoc_cm_pre(MDOC_ARGS)
         if ((id = cond_id(n)) != NULL)          if ((id = cond_id(n)) != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         print_otag(h, TAG_CODE, "cTi", "Cm", id);          print_otag(h, TAG_CODE, "cTi", "Cm", id);
         free(id);  
         return 1;          return 1;
 }  }
   
Line 583  mdoc_nd_pre(MDOC_ARGS)
Line 579  mdoc_nd_pre(MDOC_ARGS)
         if (n->type != ROFFT_BODY)          if (n->type != ROFFT_BODY)
                 return 1;                  return 1;
   
         /* XXX: this tag in theory can contain block elements. */  
   
         print_text(h, "\\(em");          print_text(h, "\\(em");
         print_otag(h, TAG_SPAN, "cT", "Nd");          /* Cannot use TAG_SPAN because it may contain blocks. */
           print_otag(h, TAG_DIV, "cT", "Nd");
         return 1;          return 1;
 }  }
   
Line 883  mdoc_sx_pre(MDOC_ARGS)
Line 878  mdoc_sx_pre(MDOC_ARGS)
 {  {
         char    *id;          char    *id;
   
         id = html_make_id(n);          id = html_make_id(n, 0);
         print_otag(h, TAG_A, "cThR", "Sx", id);          print_otag(h, TAG_A, "cThR", "Sx", id);
         free(id);          free(id);
         return 1;          return 1;
Line 980  mdoc_bd_pre(MDOC_ARGS)
Line 975  mdoc_bd_pre(MDOC_ARGS)
 static int  static int
 mdoc_pa_pre(MDOC_ARGS)  mdoc_pa_pre(MDOC_ARGS)
 {  {
         print_otag(h, TAG_I, "cT", "Pa");          print_otag(h, TAG_SPAN, "cT", "Pa");
         return 1;          return 1;
 }  }
   
 static int  static int
 mdoc_ad_pre(MDOC_ARGS)  mdoc_ad_pre(MDOC_ARGS)
 {  {
         print_otag(h, TAG_I, "c", "Ad");          print_otag(h, TAG_SPAN, "c", "Ad");
         return 1;          return 1;
 }  }
   
Line 1031  mdoc_dv_pre(MDOC_ARGS)
Line 1026  mdoc_dv_pre(MDOC_ARGS)
         if ((id = cond_id(n)) != NULL)          if ((id = cond_id(n)) != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         print_otag(h, TAG_CODE, "cTi", "Dv", id);          print_otag(h, TAG_CODE, "cTi", "Dv", id);
         free(id);  
         return 1;          return 1;
 }  }
   
Line 1043  mdoc_ev_pre(MDOC_ARGS)
Line 1037  mdoc_ev_pre(MDOC_ARGS)
         if ((id = cond_id(n)) != NULL)          if ((id = cond_id(n)) != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         print_otag(h, TAG_CODE, "cTi", "Ev", id);          print_otag(h, TAG_CODE, "cTi", "Ev", id);
         free(id);  
         return 1;          return 1;
 }  }
   
Line 1056  mdoc_er_pre(MDOC_ARGS)
Line 1049  mdoc_er_pre(MDOC_ARGS)
             (n->parent->tok == MDOC_It ||              (n->parent->tok == MDOC_It ||
              (n->parent->tok == MDOC_Bq &&               (n->parent->tok == MDOC_Bq &&
               n->parent->parent->parent->tok == MDOC_It)) ?                n->parent->parent->parent->tok == MDOC_It)) ?
             html_make_id(n) : NULL;              html_make_id(n, 1) : NULL;
   
         if (id != NULL)          if (id != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         print_otag(h, TAG_CODE, "cTi", "Er", id);          print_otag(h, TAG_CODE, "cTi", "Er", id);
         free(id);  
         return 1;          return 1;
 }  }
   
Line 1412  mdoc_ic_pre(MDOC_ARGS)
Line 1404  mdoc_ic_pre(MDOC_ARGS)
         if ((id = cond_id(n)) != NULL)          if ((id = cond_id(n)) != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         print_otag(h, TAG_CODE, "cTi", "Ic", id);          print_otag(h, TAG_CODE, "cTi", "Ic", id);
         free(id);  
         return 1;          return 1;
 }  }
   
Line 1444  mdoc_bf_pre(MDOC_ARGS)
Line 1435  mdoc_bf_pre(MDOC_ARGS)
                 return 1;                  return 1;
   
         if (FONT_Em == n->norm->Bf.font)          if (FONT_Em == n->norm->Bf.font)
                 cattr = "Em";                  cattr = "Bf Em";
         else if (FONT_Sy == n->norm->Bf.font)          else if (FONT_Sy == n->norm->Bf.font)
                 cattr = "Sy";                  cattr = "Bf Sy";
         else if (FONT_Li == n->norm->Bf.font)          else if (FONT_Li == n->norm->Bf.font)
                 cattr = "Li";                  cattr = "Bf Li";
         else          else
                 cattr = "No";                  cattr = "Bf No";
   
         /*          /* Cannot use TAG_SPAN because it may contain blocks. */
          * We want this to be inline-formatted, but needs to be div to          print_otag(h, TAG_DIV, "cshl", cattr, 1);
          * accept block children.  
          */  
   
         print_otag(h, TAG_DIV, "css?hl", cattr, "display", "inline", 1);  
         return 1;          return 1;
 }  }
   
Line 1468  mdoc_ms_pre(MDOC_ARGS)
Line 1455  mdoc_ms_pre(MDOC_ARGS)
   
         if ((id = cond_id(n)) != NULL)          if ((id = cond_id(n)) != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         print_otag(h, TAG_B, "cTi", "Ms", id);          print_otag(h, TAG_SPAN, "cTi", "Ms", id);
         free(id);  
         return 1;          return 1;
 }  }
   
Line 1510  mdoc_no_pre(MDOC_ARGS)
Line 1496  mdoc_no_pre(MDOC_ARGS)
         if ((id = cond_id(n)) != NULL)          if ((id = cond_id(n)) != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         print_otag(h, TAG_SPAN, "ci", "No", id);          print_otag(h, TAG_SPAN, "ci", "No", id);
         free(id);  
         return 1;          return 1;
 }  }
   
Line 1522  mdoc_li_pre(MDOC_ARGS)
Line 1507  mdoc_li_pre(MDOC_ARGS)
         if ((id = cond_id(n)) != NULL)          if ((id = cond_id(n)) != NULL)
                 print_otag(h, TAG_A, "chR", "permalink", id);                  print_otag(h, TAG_A, "chR", "permalink", id);
         print_otag(h, TAG_CODE, "ci", "Li", id);          print_otag(h, TAG_CODE, "ci", "Li", id);
         free(id);  
         return 1;          return 1;
 }  }
   
Line 1678  mdoc_quote_pre(MDOC_ARGS)
Line 1662  mdoc_quote_pre(MDOC_ARGS)
         case MDOC_Op:          case MDOC_Op:
                 print_text(h, "\\(lB");                  print_text(h, "\\(lB");
                 h->flags |= HTML_NOSPACE;                  h->flags |= HTML_NOSPACE;
                 print_otag(h, TAG_SPAN, "c", "Op");                  /* Cannot use TAG_SPAN because it may contain blocks. */
                   print_otag(h, TAG_IDIV, "c", "Op");
                 break;                  break;
         case MDOC_En:          case MDOC_En:
                 if (NULL == n->norm->Es ||                  if (NULL == n->norm->Es ||

Legend:
Removed from v.1.299  
changed lines
  Added in v.1.304

CVSweb