[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.148 and 1.152

version 1.148, 2011/01/25 16:20:24 version 1.152, 2011/02/06 23:02:31
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  *   *
  * 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 422  print_mdoc_node(MDOC_ARGS)
Line 422  print_mdoc_node(MDOC_ARGS)
         case (MDOC_TEXT):          case (MDOC_TEXT):
                 /* No tables in this mode... */                  /* No tables in this mode... */
                 assert(NULL == h->tblt);                  assert(NULL == h->tblt);
   
                   /*
                    * Make sure that if we're in a literal mode already
                    * (i.e., within a <PRE>) don't print the newline.
                    */
                 if (' ' == *n->string && MDOC_LINE & n->flags)                  if (' ' == *n->string && MDOC_LINE & n->flags)
                         print_otag(h, TAG_BR, 0, NULL);                          if ( ! (HTML_LITERAL & h->flags))
                                   print_otag(h, TAG_BR, 0, NULL);
                 print_text(h, n->string);                  print_text(h, n->string);
                 return;                  return;
           case (MDOC_EQN):
                   return;
         case (MDOC_TBL):          case (MDOC_TBL):
                 /*                  /*
                  * This will take care of initialising all of the table                   * This will take care of initialising all of the table
Line 774  static int
Line 782  static int
 mdoc_ns_pre(MDOC_ARGS)  mdoc_ns_pre(MDOC_ARGS)
 {  {
   
         h->flags |= HTML_NOSPACE;          if ( ! (MDOC_LINE & n->flags))
                   h->flags |= HTML_NOSPACE;
         return(1);          return(1);
 }  }
   
Line 797  mdoc_xx_pre(MDOC_ARGS)
Line 806  mdoc_xx_pre(MDOC_ARGS)
 {  {
         const char      *pp;          const char      *pp;
         struct htmlpair  tag;          struct htmlpair  tag;
           int              flags;
   
         switch (n->tok) {          switch (n->tok) {
         case (MDOC_Bsx):          case (MDOC_Bsx):
Line 826  mdoc_xx_pre(MDOC_ARGS)
Line 836  mdoc_xx_pre(MDOC_ARGS)
   
         print_text(h, pp);          print_text(h, pp);
         if (n->child) {          if (n->child) {
                   flags = h->flags;
                 h->flags |= HTML_KEEP;                  h->flags |= HTML_KEEP;
                 print_text(h, n->child->string);                  print_text(h, n->child->string);
                 h->flags &= ~HTML_KEEP;                  h->flags = flags;
         }          }
         return(0);          return(0);
 }  }
Line 1175  static int
Line 1186  static int
 mdoc_bd_pre(MDOC_ARGS)  mdoc_bd_pre(MDOC_ARGS)
 {  {
         struct htmlpair          tag[2];          struct htmlpair          tag[2];
         int                      comp;          int                      comp, sv;
         const struct mdoc_node  *nn;          const struct mdoc_node  *nn;
         struct roffsu            su;          struct roffsu            su;
   
Line 1214  mdoc_bd_pre(MDOC_ARGS)
Line 1225  mdoc_bd_pre(MDOC_ARGS)
         PAIR_CLASS_INIT(&tag[1], "lit display");          PAIR_CLASS_INIT(&tag[1], "lit display");
         print_otag(h, TAG_PRE, 2, tag);          print_otag(h, TAG_PRE, 2, tag);
   
           /* This can be recursive: save & set our literal state. */
   
           sv = h->flags & HTML_LITERAL;
           h->flags |= HTML_LITERAL;
   
         for (nn = n->child; nn; nn = nn->next) {          for (nn = n->child; nn; nn = nn->next) {
                 print_mdoc_node(m, nn, h);                  print_mdoc_node(m, nn, h);
                 /*                  /*
Line 1249  mdoc_bd_pre(MDOC_ARGS)
Line 1265  mdoc_bd_pre(MDOC_ARGS)
   
                 h->flags |= HTML_NOSPACE;                  h->flags |= HTML_NOSPACE;
         }          }
   
           if (0 == sv)
                   h->flags &= ~HTML_LITERAL;
   
         return(0);          return(0);
 }  }

Legend:
Removed from v.1.148  
changed lines
  Added in v.1.152

CVSweb