[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.221 and 1.226

version 1.221, 2015/02/01 23:10:35 version 1.226, 2015/03/03 21:11:34
Line 35 
Line 35 
 #define INDENT           5  #define INDENT           5
   
 #define MDOC_ARGS         const struct mdoc_meta *meta, \  #define MDOC_ARGS         const struct mdoc_meta *meta, \
                           const struct mdoc_node *n, \                            struct mdoc_node *n, \
                           struct html *h                            struct html *h
   
 #ifndef MIN  #ifndef MIN
Line 267  void
Line 267  void
 html_mdoc(void *arg, const struct mdoc *mdoc)  html_mdoc(void *arg, const struct mdoc *mdoc)
 {  {
   
         print_mdoc(mdoc_meta(mdoc), mdoc_node(mdoc),          print_mdoc(mdoc_meta(mdoc), mdoc_node(mdoc)->child,
             (struct html *)arg);              (struct html *)arg);
         putchar('\n');          putchar('\n');
 }  }
Line 387  print_mdoc_node(MDOC_ARGS)
Line 387  print_mdoc_node(MDOC_ARGS)
   
         child = 1;          child = 1;
         t = h->tags.head;          t = h->tags.head;
           n->flags &= ~MDOC_ENDED;
   
         switch (n->type) {          switch (n->type) {
         case MDOC_ROOT:          case MDOC_ROOT:
Line 410  print_mdoc_node(MDOC_ARGS)
Line 411  print_mdoc_node(MDOC_ARGS)
                         h->flags |= HTML_NOSPACE;                          h->flags |= HTML_NOSPACE;
                 return;                  return;
         case MDOC_EQN:          case MDOC_EQN:
                   if (n->flags & MDOC_LINE)
                           putchar('\n');
                 print_eqn(h, n->eqn);                  print_eqn(h, n->eqn);
                 break;                  break;
         case MDOC_TBL:          case MDOC_TBL:
Line 436  print_mdoc_node(MDOC_ARGS)
Line 439  print_mdoc_node(MDOC_ARGS)
                 break;                  break;
         }          }
   
         if (HTML_KEEP & h->flags) {          if (h->flags & HTML_KEEP && n->flags & MDOC_LINE) {
                 if (n->prev ? (n->prev->lastline != n->line) :                  h->flags &= ~HTML_KEEP;
                     (n->parent && n->parent->line != n->line)) {                  h->flags |= HTML_PREKEEP;
                         h->flags &= ~HTML_KEEP;  
                         h->flags |= HTML_PREKEEP;  
                 }  
         }          }
   
         if (child && n->child)          if (child && n->child)
Line 460  print_mdoc_node(MDOC_ARGS)
Line 460  print_mdoc_node(MDOC_ARGS)
                         break;                          break;
                 (*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->pending->flags |= MDOC_ENDED;                          n->body->flags |= MDOC_ENDED;
                 if (n->end == ENDBODY_NOSPACE)                  if (n->end == ENDBODY_NOSPACE)
                         h->flags |= HTML_NOSPACE;                          h->flags |= HTML_NOSPACE;
                 break;                  break;
Line 1125  mdoc_bd_pre(MDOC_ARGS)
Line 1125  mdoc_bd_pre(MDOC_ARGS)
 {  {
         struct htmlpair          tag[2];          struct htmlpair          tag[2];
         int                      comp, sv;          int                      comp, sv;
         const struct mdoc_node  *nn;          struct mdoc_node        *nn;
         struct roffsu            su;          struct roffsu            su;
   
         if (MDOC_HEAD == n->type)          if (MDOC_HEAD == n->type)
Line 1256  mdoc_an_pre(MDOC_ARGS)
Line 1256  mdoc_an_pre(MDOC_ARGS)
                 return(0);                  return(0);
         }          }
   
         if (n->child == NULL)  
                 return(0);  
   
         if (h->flags & HTML_SPLIT)          if (h->flags & HTML_SPLIT)
                 print_otag(h, TAG_BR, 0, NULL);                  print_otag(h, TAG_BR, 0, NULL);
   
Line 2226  mdoc_eo_pre(MDOC_ARGS)
Line 2223  mdoc_eo_pre(MDOC_ARGS)
             n->child->end != ENDBODY_NOT)              n->child->end != ENDBODY_NOT)
                 print_text(h, "\\&");                  print_text(h, "\\&");
         else if (n->end != ENDBODY_NOT ? n->child != NULL :          else if (n->end != ENDBODY_NOT ? n->child != NULL :
             n->parent->head->child != NULL &&              n->parent->head->child != NULL && (n->child != NULL ||
             (n->parent->body->child != NULL ||              (n->parent->tail != NULL && n->parent->tail->child != NULL)))
              n->parent->tail->child != NULL))  
                 h->flags |= HTML_NOSPACE;                  h->flags |= HTML_NOSPACE;
         return(1);          return(1);
 }  }

Legend:
Removed from v.1.221  
changed lines
  Added in v.1.226

CVSweb