[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.220 and 1.221

version 1.220, 2015/01/30 22:04:44 version 1.221, 2015/02/01 23:10:35
Line 81  static int    mdoc_fl_pre(MDOC_ARGS);
Line 81  static int    mdoc_fl_pre(MDOC_ARGS);
 static  int               mdoc_fn_pre(MDOC_ARGS);  static  int               mdoc_fn_pre(MDOC_ARGS);
 static  int               mdoc_ft_pre(MDOC_ARGS);  static  int               mdoc_ft_pre(MDOC_ARGS);
 static  int               mdoc_em_pre(MDOC_ARGS);  static  int               mdoc_em_pre(MDOC_ARGS);
   static  void              mdoc_eo_post(MDOC_ARGS);
   static  int               mdoc_eo_pre(MDOC_ARGS);
 static  int               mdoc_er_pre(MDOC_ARGS);  static  int               mdoc_er_pre(MDOC_ARGS);
 static  int               mdoc_ev_pre(MDOC_ARGS);  static  int               mdoc_ev_pre(MDOC_ARGS);
 static  int               mdoc_ex_pre(MDOC_ARGS);  static  int               mdoc_ex_pre(MDOC_ARGS);
Line 189  static const struct htmlmdoc mdocs[MDOC_MAX] = {
Line 191  static const struct htmlmdoc mdocs[MDOC_MAX] = {
         {NULL, NULL}, /* Ec */ /* FIXME: no space */          {NULL, NULL}, /* Ec */ /* FIXME: no space */
         {NULL, NULL}, /* Ef */          {NULL, NULL}, /* Ef */
         {mdoc_em_pre, NULL}, /* Em */          {mdoc_em_pre, NULL}, /* Em */
         {mdoc_quote_pre, mdoc_quote_post}, /* Eo */          {mdoc_eo_pre, mdoc_eo_post}, /* Eo */
         {mdoc_xx_pre, NULL}, /* Fx */          {mdoc_xx_pre, NULL}, /* Fx */
         {mdoc_ms_pre, NULL}, /* Ms */          {mdoc_ms_pre, NULL}, /* Ms */
         {mdoc_no_pre, NULL}, /* No */          {mdoc_no_pre, NULL}, /* No */
Line 2112  mdoc_quote_pre(MDOC_ARGS)
Line 2114  mdoc_quote_pre(MDOC_ARGS)
                         return(1);                          return(1);
                 print_text(h, n->norm->Es->child->string);                  print_text(h, n->norm->Es->child->string);
                 break;                  break;
         case MDOC_Eo:  
                 break;  
         case MDOC_Do:          case MDOC_Do:
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case MDOC_Dq:          case MDOC_Dq:
Line 2155  mdoc_quote_post(MDOC_ARGS)
Line 2155  mdoc_quote_post(MDOC_ARGS)
         if (n->type != MDOC_BODY && n->type != MDOC_ELEM)          if (n->type != MDOC_BODY && n->type != MDOC_ELEM)
                 return;                  return;
   
         if ( ! (n->tok == MDOC_En ||          h->flags |= HTML_NOSPACE;
             (n->tok == MDOC_Eo && n->end == ENDBODY_SPACE)))  
                 h->flags |= HTML_NOSPACE;  
   
         switch (n->tok) {          switch (n->tok) {
         case MDOC_Ao:          case MDOC_Ao:
Line 2181  mdoc_quote_post(MDOC_ARGS)
Line 2179  mdoc_quote_post(MDOC_ARGS)
                 print_text(h, "\\(rB");                  print_text(h, "\\(rB");
                 break;                  break;
         case MDOC_En:          case MDOC_En:
                 if (NULL != n->norm->Es &&                  if (n->norm->Es == NULL ||
                     NULL != n->norm->Es->child &&                      n->norm->Es->child == NULL ||
                     NULL != n->norm->Es->child->next) {                      n->norm->Es->child->next == NULL)
                         h->flags |= HTML_NOSPACE;                          h->flags &= ~HTML_NOSPACE;
                   else
                         print_text(h, n->norm->Es->child->next->string);                          print_text(h, n->norm->Es->child->next->string);
                 }  
                 break;                  break;
         case MDOC_Eo:  
                 break;  
         case MDOC_Qo:          case MDOC_Qo:
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case MDOC_Qq:          case MDOC_Qq:
Line 2215  mdoc_quote_post(MDOC_ARGS)
Line 2211  mdoc_quote_post(MDOC_ARGS)
                 abort();                  abort();
                 /* NOTREACHED */                  /* NOTREACHED */
         }          }
   }
   
   static int
   mdoc_eo_pre(MDOC_ARGS)
   {
   
           if (n->type != MDOC_BODY)
                   return(1);
   
           if (n->end == ENDBODY_NOT &&
               n->parent->head->child == NULL &&
               n->child != NULL &&
               n->child->end != ENDBODY_NOT)
                   print_text(h, "\\&");
           else if (n->end != ENDBODY_NOT ? n->child != NULL :
               n->parent->head->child != NULL &&
               (n->parent->body->child != NULL ||
                n->parent->tail->child != NULL))
                   h->flags |= HTML_NOSPACE;
           return(1);
   }
   
   static void
   mdoc_eo_post(MDOC_ARGS)
   {
           int      body, tail;
   
           if (n->type != MDOC_BODY)
                   return;
   
           if (n->end != ENDBODY_NOT) {
                   h->flags &= ~HTML_NOSPACE;
                   return;
           }
   
           body = n->child != NULL || n->parent->head->child != NULL;
           tail = n->parent->tail != NULL && n->parent->tail->child != NULL;
   
           if (body && tail)
                   h->flags |= HTML_NOSPACE;
           else if ( ! tail)
                   h->flags &= ~HTML_NOSPACE;
 }  }

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

CVSweb