[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.264 and 1.271

version 1.264, 2017/01/29 14:02:42 version 1.271, 2017/02/16 03:00:23
Line 110  static int    mdoc_skip_pre(MDOC_ARGS);
Line 110  static int    mdoc_skip_pre(MDOC_ARGS);
 static  int               mdoc_sm_pre(MDOC_ARGS);  static  int               mdoc_sm_pre(MDOC_ARGS);
 static  int               mdoc_sp_pre(MDOC_ARGS);  static  int               mdoc_sp_pre(MDOC_ARGS);
 static  int               mdoc_ss_pre(MDOC_ARGS);  static  int               mdoc_ss_pre(MDOC_ARGS);
   static  int               mdoc_st_pre(MDOC_ARGS);
 static  int               mdoc_sx_pre(MDOC_ARGS);  static  int               mdoc_sx_pre(MDOC_ARGS);
 static  int               mdoc_sy_pre(MDOC_ARGS);  static  int               mdoc_sy_pre(MDOC_ARGS);
 static  int               mdoc_va_pre(MDOC_ARGS);  static  int               mdoc_va_pre(MDOC_ARGS);
Line 155  static const struct htmlmdoc mdocs[MDOC_MAX] = {
Line 156  static const struct htmlmdoc mdocs[MDOC_MAX] = {
         {mdoc_ft_pre, NULL}, /* Ot */          {mdoc_ft_pre, NULL}, /* Ot */
         {mdoc_pa_pre, NULL}, /* Pa */          {mdoc_pa_pre, NULL}, /* Pa */
         {mdoc_ex_pre, NULL}, /* Rv */          {mdoc_ex_pre, NULL}, /* Rv */
         {NULL, NULL}, /* St */          {mdoc_st_pre, NULL}, /* St */
         {mdoc_va_pre, NULL}, /* Va */          {mdoc_va_pre, NULL}, /* Va */
         {mdoc_vt_pre, NULL}, /* Vt */          {mdoc_vt_pre, NULL}, /* Vt */
         {mdoc_xr_pre, NULL}, /* Xr */          {mdoc_xr_pre, NULL}, /* Xr */
Line 173  static const struct htmlmdoc mdocs[MDOC_MAX] = {
Line 174  static const struct htmlmdoc mdocs[MDOC_MAX] = {
         {NULL, NULL}, /* Ac */          {NULL, NULL}, /* Ac */
         {mdoc_quote_pre, mdoc_quote_post}, /* Ao */          {mdoc_quote_pre, mdoc_quote_post}, /* Ao */
         {mdoc_quote_pre, mdoc_quote_post}, /* Aq */          {mdoc_quote_pre, mdoc_quote_post}, /* Aq */
         {NULL, NULL}, /* At */          {mdoc_xx_pre, NULL}, /* At */
         {NULL, NULL}, /* Bc */          {NULL, NULL}, /* Bc */
         {mdoc_bf_pre, NULL}, /* Bf */          {mdoc_bf_pre, NULL}, /* Bf */
         {mdoc_quote_pre, mdoc_quote_post}, /* Bo */          {mdoc_quote_pre, mdoc_quote_post}, /* Bo */
Line 416  print_mdoc_node(MDOC_ARGS)
Line 417  print_mdoc_node(MDOC_ARGS)
                 (*mdocs[n->tok].post)(meta, n, h);                  (*mdocs[n->tok].post)(meta, n, h);
                 if (n->end != ENDBODY_NOT)                  if (n->end != ENDBODY_NOT)
                         n->body->flags |= NODE_ENDED;                          n->body->flags |= NODE_ENDED;
                 if (n->end == ENDBODY_NOSPACE)  
                         h->flags |= HTML_NOSPACE;  
                 break;                  break;
         }          }
 }  }
Line 428  mdoc_root_post(MDOC_ARGS)
Line 427  mdoc_root_post(MDOC_ARGS)
         struct tag      *t, *tt;          struct tag      *t, *tt;
   
         t = print_otag(h, TAG_TABLE, "c", "foot");          t = print_otag(h, TAG_TABLE, "c", "foot");
         print_otag(h, TAG_TBODY, "");  
         tt = print_otag(h, TAG_TR, "");          tt = print_otag(h, TAG_TR, "");
   
         print_otag(h, TAG_TD, "c", "foot-date");          print_otag(h, TAG_TD, "c", "foot-date");
Line 459  mdoc_root_pre(MDOC_ARGS)
Line 457  mdoc_root_pre(MDOC_ARGS)
                     meta->title, meta->msec);                      meta->title, meta->msec);
   
         t = print_otag(h, TAG_TABLE, "c", "head");          t = print_otag(h, TAG_TABLE, "c", "head");
         print_otag(h, TAG_TBODY, "");  
         tt = print_otag(h, TAG_TR, "");          tt = print_otag(h, TAG_TR, "");
   
         print_otag(h, TAG_TD, "c", "head-ltitle");          print_otag(h, TAG_TD, "c", "head-ltitle");
Line 574  mdoc_nd_pre(MDOC_ARGS)
Line 571  mdoc_nd_pre(MDOC_ARGS)
 static int  static int
 mdoc_nm_pre(MDOC_ARGS)  mdoc_nm_pre(MDOC_ARGS)
 {  {
           struct tag      *t;
         int              len;          int              len;
   
         switch (n->type) {          switch (n->type) {
Line 582  mdoc_nm_pre(MDOC_ARGS)
Line 580  mdoc_nm_pre(MDOC_ARGS)
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case ROFFT_ELEM:          case ROFFT_ELEM:
                 print_otag(h, TAG_B, "c", "Nm");                  print_otag(h, TAG_B, "c", "Nm");
                 if (n->child == NULL && meta->name != NULL)  
                         print_text(h, meta->name);  
                 return 1;                  return 1;
         case ROFFT_BODY:          case ROFFT_BODY:
                 print_otag(h, TAG_TD, "");                  print_otag(h, TAG_TD, "");
Line 602  mdoc_nm_pre(MDOC_ARGS)
Line 598  mdoc_nm_pre(MDOC_ARGS)
         if (len == 0 && meta->name != NULL)          if (len == 0 && meta->name != NULL)
                 len = html_strlen(meta->name);                  len = html_strlen(meta->name);
   
           t = print_otag(h, TAG_COLGROUP, "");
         print_otag(h, TAG_COL, "shw", len);          print_otag(h, TAG_COL, "shw", len);
         print_otag(h, TAG_COL, "");          print_otag(h, TAG_COL, "");
         print_otag(h, TAG_TBODY, "");          print_tagq(h, t);
         print_otag(h, TAG_TR, "");          print_otag(h, TAG_TR, "");
         return 1;          return 1;
 }  }
Line 649  mdoc_ns_pre(MDOC_ARGS)
Line 646  mdoc_ns_pre(MDOC_ARGS)
 static int  static int
 mdoc_ar_pre(MDOC_ARGS)  mdoc_ar_pre(MDOC_ARGS)
 {  {
         print_otag(h, TAG_I, "c", "Ar");          print_otag(h, TAG_VAR, "c", "Ar");
         return 1;          return 1;
 }  }
   
Line 801  mdoc_it_pre(MDOC_ARGS)
Line 798  mdoc_it_pre(MDOC_ARGS)
 static int  static int
 mdoc_bl_pre(MDOC_ARGS)  mdoc_bl_pre(MDOC_ARGS)
 {  {
           struct tag      *t;
         struct mdoc_bl  *bl;          struct mdoc_bl  *bl;
         const char      *cattr;          const char      *cattr;
         size_t           i;          size_t           i;
Line 808  mdoc_bl_pre(MDOC_ARGS)
Line 806  mdoc_bl_pre(MDOC_ARGS)
   
         bl = &n->norm->Bl;          bl = &n->norm->Bl;
   
         if (n->type == ROFFT_BODY) {          switch (n->type) {
                 if (bl->type == LIST_column)          case ROFFT_BODY:
                         print_otag(h, TAG_TBODY, "");  
                 return 1;                  return 1;
         }  
   
         if (n->type == ROFFT_HEAD) {          case ROFFT_HEAD:
                 if (bl->type != LIST_column || bl->ncols == 0)                  if (bl->type != LIST_column || bl->ncols == 0)
                         return 0;                          return 0;
   
Line 825  mdoc_bl_pre(MDOC_ARGS)
Line 821  mdoc_bl_pre(MDOC_ARGS)
                  * screen and we want to preserve that behaviour.                   * screen and we want to preserve that behaviour.
                  */                   */
   
                   t = print_otag(h, TAG_COLGROUP, "");
                 for (i = 0; i < bl->ncols - 1; i++)                  for (i = 0; i < bl->ncols - 1; i++)
                         print_otag(h, TAG_COL, "sww", bl->cols[i]);                          print_otag(h, TAG_COL, "sww", bl->cols[i]);
                 print_otag(h, TAG_COL, "swW", bl->cols[i]);                  print_otag(h, TAG_COL, "swW", bl->cols[i]);
                   print_tagq(h, t);
                 return 0;                  return 0;
   
           default:
                   break;
         }          }
   
         switch (bl->type) {          switch (bl->type) {
Line 891  mdoc_ex_pre(MDOC_ARGS)
Line 892  mdoc_ex_pre(MDOC_ARGS)
 }  }
   
 static int  static int
   mdoc_st_pre(MDOC_ARGS)
   {
           print_otag(h, TAG_SPAN, "c", "St");
           return 1;
   }
   
   static int
 mdoc_em_pre(MDOC_ARGS)  mdoc_em_pre(MDOC_ARGS)
 {  {
         print_otag(h, TAG_I, "c", "Em");          print_otag(h, TAG_I, "c", "Em");
Line 1084  mdoc_fa_pre(MDOC_ARGS)
Line 1092  mdoc_fa_pre(MDOC_ARGS)
         struct tag              *t;          struct tag              *t;
   
         if (n->parent->tok != MDOC_Fo) {          if (n->parent->tok != MDOC_Fo) {
                 print_otag(h, TAG_I, "c", "Fa");                  print_otag(h, TAG_VAR, "c", "Fa");
                 return 1;                  return 1;
         }          }
   
         for (nn = n->child; nn; nn = nn->next) {          for (nn = n->child; nn; nn = nn->next) {
                 t = print_otag(h, TAG_I, "c", "Fa");                  t = print_otag(h, TAG_VAR, "c", "Fa");
                 print_text(h, nn->string);                  print_text(h, nn->string);
                 print_tagq(h, t);                  print_tagq(h, t);
                 if (nn->next) {                  if (nn->next) {
Line 1168  mdoc_vt_pre(MDOC_ARGS)
Line 1176  mdoc_vt_pre(MDOC_ARGS)
         } else if (n->type == ROFFT_HEAD)          } else if (n->type == ROFFT_HEAD)
                 return 0;                  return 0;
   
         print_otag(h, TAG_I, "c", "Vt");          print_otag(h, TAG_VAR, "c", "Vt");
         return 1;          return 1;
 }  }
   
Line 1176  static int
Line 1184  static int
 mdoc_ft_pre(MDOC_ARGS)  mdoc_ft_pre(MDOC_ARGS)
 {  {
         synopsis_pre(h, n);          synopsis_pre(h, n);
         print_otag(h, TAG_I, "c", "Ft");          print_otag(h, TAG_VAR, "c", "Ft");
         return 1;          return 1;
 }  }
   
Line 1197  mdoc_fn_pre(MDOC_ARGS)
Line 1205  mdoc_fn_pre(MDOC_ARGS)
   
         ep = strchr(sp, ' ');          ep = strchr(sp, ' ');
         if (NULL != ep) {          if (NULL != ep) {
                 t = print_otag(h, TAG_I, "c", "Ft");                  t = print_otag(h, TAG_VAR, "c", "Ft");
   
                 while (ep) {                  while (ep) {
                         sz = MIN((int)(ep - sp), BUFSIZ - 1);                          sz = MIN((int)(ep - sp), BUFSIZ - 1);
Line 1223  mdoc_fn_pre(MDOC_ARGS)
Line 1231  mdoc_fn_pre(MDOC_ARGS)
   
         for (n = n->child->next; n; n = n->next) {          for (n = n->child->next; n; n = n->next) {
                 if (NODE_SYNPRETTY & n->flags)                  if (NODE_SYNPRETTY & n->flags)
                         t = print_otag(h, TAG_I, "css?", "Fa",                          t = print_otag(h, TAG_VAR, "css?", "Fa",
                             "white-space", "nowrap");                              "white-space", "nowrap");
                 else                  else
                         t = print_otag(h, TAG_I, "c", "Fa");                          t = print_otag(h, TAG_VAR, "c", "Fa");
                 print_text(h, n->string);                  print_text(h, n->string);
                 print_tagq(h, t);                  print_tagq(h, t);
                 if (n->next) {                  if (n->next) {
Line 1434  mdoc_ic_pre(MDOC_ARGS)
Line 1442  mdoc_ic_pre(MDOC_ARGS)
 static int  static int
 mdoc_va_pre(MDOC_ARGS)  mdoc_va_pre(MDOC_ARGS)
 {  {
         print_otag(h, TAG_I, "c", "Va");          print_otag(h, TAG_VAR, "c", "Va");
         return 1;          return 1;
 }  }
   
Line 1465  mdoc_bf_pre(MDOC_ARGS)
Line 1473  mdoc_bf_pre(MDOC_ARGS)
         else if (FONT_Li == n->norm->Bf.font)          else if (FONT_Li == n->norm->Bf.font)
                 cattr = "Li";                  cattr = "Li";
         else          else
                 cattr = "none";                  cattr = "No";
   
         /*          /*
          * We want this to be inline-formatted, but needs to be div to           * We want this to be inline-formatted, but needs to be div to
Line 1508  mdoc_rs_pre(MDOC_ARGS)
Line 1516  mdoc_rs_pre(MDOC_ARGS)
         if (n->prev && SEC_SEE_ALSO == n->sec)          if (n->prev && SEC_SEE_ALSO == n->sec)
                 print_paragraph(h);                  print_paragraph(h);
   
         print_otag(h, TAG_SPAN, "c", "Rs");          print_otag(h, TAG_CITE, "c", "Rs");
         return 1;          return 1;
 }  }
   

Legend:
Removed from v.1.264  
changed lines
  Added in v.1.271

CVSweb