[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.239 and 1.240

version 1.239, 2016/01/04 12:45:29 version 1.240, 2016/01/08 17:48:09
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 602  mdoc_fl_pre(MDOC_ARGS)
Line 602  mdoc_fl_pre(MDOC_ARGS)
   
         print_text(h, "\\-");          print_text(h, "\\-");
   
         if ( ! (n->nchild == 0 &&          if (!(n->child == NULL &&
             (n->next == NULL ||              (n->next == NULL ||
              n->next->type == ROFFT_TEXT ||               n->next->type == ROFFT_TEXT ||
              n->next->flags & MDOC_LINE)))               n->next->flags & MDOC_LINE)))
Line 979  mdoc_bl_pre(MDOC_ARGS)
Line 979  mdoc_bl_pre(MDOC_ARGS)
 static int  static int
 mdoc_ex_pre(MDOC_ARGS)  mdoc_ex_pre(MDOC_ARGS)
 {  {
         struct tag      *t;          struct htmlpair   tag;
         struct htmlpair  tag;          struct tag       *t;
         int              nchild;          struct roff_node *nch;
   
         if (n->prev)          if (n->prev)
                 print_otag(h, TAG_BR, 0, NULL);                  print_otag(h, TAG_BR, 0, NULL);
Line 990  mdoc_ex_pre(MDOC_ARGS)
Line 990  mdoc_ex_pre(MDOC_ARGS)
   
         print_text(h, "The");          print_text(h, "The");
   
         nchild = n->nchild;          for (nch = n->child; nch != NULL; nch = nch->next) {
         for (n = n->child; n; n = n->next) {                  assert(nch->type == ROFFT_TEXT);
                 assert(n->type == ROFFT_TEXT);  
   
                 t = print_otag(h, TAG_B, 1, &tag);                  t = print_otag(h, TAG_B, 1, &tag);
                 print_text(h, n->string);                  print_text(h, nch->string);
                 print_tagq(h, t);                  print_tagq(h, t);
   
                 if (nchild > 2 && n->next) {                  if (nch->next == NULL)
                           continue;
   
                   if (nch->prev != NULL || nch->next->next != NULL) {
                         h->flags |= HTML_NOSPACE;                          h->flags |= HTML_NOSPACE;
                         print_text(h, ",");                          print_text(h, ",");
                 }                  }
   
                 if (n->next && NULL == n->next->next)                  if (nch->next->next == NULL)
                         print_text(h, "and");                          print_text(h, "and");
         }          }
   
         if (nchild > 1)          if (n->child != NULL && n->child->next != NULL)
                 print_text(h, "utilities exit\\~0");                  print_text(h, "utilities exit\\~0");
         else          else
                 print_text(h, "utility exits\\~0");                  print_text(h, "utility exits\\~0");
Line 1695  mdoc_rv_pre(MDOC_ARGS)
Line 1697  mdoc_rv_pre(MDOC_ARGS)
 {  {
         struct htmlpair  tag;          struct htmlpair  tag;
         struct tag      *t;          struct tag      *t;
         int              nchild;          struct roff_node *nch;
   
         if (n->prev)          if (n->prev)
                 print_otag(h, TAG_BR, 0, NULL);                  print_otag(h, TAG_BR, 0, NULL);
   
         PAIR_CLASS_INIT(&tag, "fname");          PAIR_CLASS_INIT(&tag, "fname");
   
         nchild = n->nchild;          if (n->child != NULL) {
         if (nchild > 0) {  
                 print_text(h, "The");                  print_text(h, "The");
   
                 for (n = n->child; n; n = n->next) {                  for (nch = n->child; nch != NULL; nch = nch->next) {
                         t = print_otag(h, TAG_B, 1, &tag);                          t = print_otag(h, TAG_B, 1, &tag);
                         print_text(h, n->string);                          print_text(h, nch->string);
                         print_tagq(h, t);                          print_tagq(h, t);
   
                         h->flags |= HTML_NOSPACE;                          h->flags |= HTML_NOSPACE;
                         print_text(h, "()");                          print_text(h, "()");
   
                         if (n->next == NULL)                          if (nch->next == NULL)
                                 continue;                                  continue;
   
                         if (nchild > 2) {                          if (nch->prev != NULL || nch->next->next != NULL) {
                                 h->flags |= HTML_NOSPACE;                                  h->flags |= HTML_NOSPACE;
                                 print_text(h, ",");                                  print_text(h, ",");
                         }                          }
                         if (n->next->next == NULL)                          if (nch->next->next == NULL)
                                 print_text(h, "and");                                  print_text(h, "and");
                 }                  }
   
                 if (nchild > 1)                  if (n->child != NULL && n->child->next != NULL)
                         print_text(h, "functions return");                          print_text(h, "functions return");
                 else                  else
                         print_text(h, "function returns");                          print_text(h, "function returns");
Line 2001  mdoc_bk_pre(MDOC_ARGS)
Line 2002  mdoc_bk_pre(MDOC_ARGS)
         case ROFFT_HEAD:          case ROFFT_HEAD:
                 return 0;                  return 0;
         case ROFFT_BODY:          case ROFFT_BODY:
                 if (n->parent->args || 0 == n->prev->nchild)                  if (n->parent->args != NULL || n->prev->child == NULL)
                         h->flags |= HTML_PREKEEP;                          h->flags |= HTML_PREKEEP;
                 break;                  break;
         default:          default:
Line 2030  mdoc_quote_pre(MDOC_ARGS)
Line 2031  mdoc_quote_pre(MDOC_ARGS)
         switch (n->tok) {          switch (n->tok) {
         case MDOC_Ao:          case MDOC_Ao:
         case MDOC_Aq:          case MDOC_Aq:
                 print_text(h, n->nchild == 1 &&                  print_text(h, n->child != NULL && n->child->next == NULL &&
                     n->child->tok == MDOC_Mt ?  "<" : "\\(la");                      n->child->tok == MDOC_Mt ?  "<" : "\\(la");
                 break;                  break;
         case MDOC_Bro:          case MDOC_Bro:
Line 2094  mdoc_quote_post(MDOC_ARGS)
Line 2095  mdoc_quote_post(MDOC_ARGS)
         switch (n->tok) {          switch (n->tok) {
         case MDOC_Ao:          case MDOC_Ao:
         case MDOC_Aq:          case MDOC_Aq:
                 print_text(h, n->nchild == 1 &&                  print_text(h, n->child != NULL && n->child->next == NULL &&
                     n->child->tok == MDOC_Mt ?  ">" : "\\(ra");                      n->child->tok == MDOC_Mt ?  ">" : "\\(ra");
                 break;                  break;
         case MDOC_Bro:          case MDOC_Bro:

Legend:
Removed from v.1.239  
changed lines
  Added in v.1.240

CVSweb