[BACK]Return to html.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/html.c between version 1.151 and 1.154

version 1.151, 2012/05/31 22:29:13 version 1.154, 2014/01/22 20:58:39
Line 1 
Line 1 
 /*      $Id$ */  /*      $Id$ */
 /*  /*
  * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>   * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
  * Copyright (c) 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>   * Copyright (c) 2011, 2012, 2013, 2014 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 235  print_metaf(struct html *h, enum mandoc_esc deco)
Line 235  print_metaf(struct html *h, enum mandoc_esc deco)
         case (ESCAPE_FONTBOLD):          case (ESCAPE_FONTBOLD):
                 font = HTMLFONT_BOLD;                  font = HTMLFONT_BOLD;
                 break;                  break;
           case (ESCAPE_FONTBI):
                   font = HTMLFONT_BI;
                   break;
         case (ESCAPE_FONT):          case (ESCAPE_FONT):
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case (ESCAPE_FONTROMAN):          case (ESCAPE_FONTROMAN):
Line 253  print_metaf(struct html *h, enum mandoc_esc deco)
Line 256  print_metaf(struct html *h, enum mandoc_esc deco)
         h->metal = h->metac;          h->metal = h->metac;
         h->metac = font;          h->metac = font;
   
         if (HTMLFONT_NONE != font)          switch (font) {
                 h->metaf = HTMLFONT_BOLD == font ?          case (HTMLFONT_ITALIC):
                         print_otag(h, TAG_B, 0, NULL) :                  h->metaf = print_otag(h, TAG_I, 0, NULL);
                         print_otag(h, TAG_I, 0, NULL);                  break;
           case (HTMLFONT_BOLD):
                   h->metaf = print_otag(h, TAG_B, 0, NULL);
                   break;
           case (HTMLFONT_BI):
                   h->metaf = print_otag(h, TAG_B, 0, NULL);
                   print_otag(h, TAG_I, 0, NULL);
                   break;
           default:
                   break;
           }
 }  }
   
 int  int
Line 318  print_encode(struct html *h, const char *p, int norecu
Line 331  print_encode(struct html *h, const char *p, int norecu
         int              c, len, nospace;          int              c, len, nospace;
         const char      *seq;          const char      *seq;
         enum mandoc_esc  esc;          enum mandoc_esc  esc;
         static const char rejs[6] = { '\\', '<', '>', '&', ASCII_HYPH, '\0' };          static const char rejs[8] = { '\\', '<', '>', '&',
                   ASCII_NBRSP, ASCII_HYPH, ASCII_BREAK, '\0' };
   
         nospace = 0;          nospace = 0;
   
Line 347  print_encode(struct html *h, const char *p, int norecu
Line 361  print_encode(struct html *h, const char *p, int norecu
                 case ('&'):                  case ('&'):
                         printf("&amp;");                          printf("&amp;");
                         continue;                          continue;
                   case (ASCII_NBRSP):
                           putchar('-');
                           continue;
                 case (ASCII_HYPH):                  case (ASCII_HYPH):
                         putchar('-');                          putchar('-');
                           /* FALLTHROUGH */
                   case (ASCII_BREAK):
                         continue;                          continue;
                 default:                  default:
                         break;                          break;
Line 367  print_encode(struct html *h, const char *p, int norecu
Line 386  print_encode(struct html *h, const char *p, int norecu
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                 case (ESCAPE_FONTITALIC):                  case (ESCAPE_FONTITALIC):
                         /* FALLTHROUGH */                          /* FALLTHROUGH */
                   case (ESCAPE_FONTBI):
                           /* FALLTHROUGH */
                 case (ESCAPE_FONTROMAN):                  case (ESCAPE_FONTROMAN):
                         if (0 == norecurse)                          if (0 == norecurse)
                                 print_metaf(h, esc);                                  print_metaf(h, esc);
Line 544  print_text(struct html *h, const char *word)
Line 565  print_text(struct html *h, const char *word)
         }          }
   
         assert(NULL == h->metaf);          assert(NULL == h->metaf);
         if (HTMLFONT_NONE != h->metac)          switch (h->metac) {
                 h->metaf = HTMLFONT_BOLD == h->metac ?          case (HTMLFONT_ITALIC):
                         print_otag(h, TAG_B, 0, NULL) :                  h->metaf = print_otag(h, TAG_I, 0, NULL);
                         print_otag(h, TAG_I, 0, NULL);                  break;
           case (HTMLFONT_BOLD):
                   h->metaf = print_otag(h, TAG_B, 0, NULL);
                   break;
           case (HTMLFONT_BI):
                   h->metaf = print_otag(h, TAG_B, 0, NULL);
                   print_otag(h, TAG_I, 0, NULL);
                   break;
           default:
                   break;
           }
   
         assert(word);          assert(word);
         if ( ! print_encode(h, word, 0)) {          if ( ! print_encode(h, word, 0)) {
Line 697  buffmt_man(struct html *h, 
Line 728  buffmt_man(struct html *h, 
                         bufcat(h, sec ? sec : "1");                          bufcat(h, sec ? sec : "1");
                         break;                          break;
                 case('N'):                  case('N'):
                         bufcat_fmt(h, name);                          bufcat_fmt(h, "%s", name);
                         break;                          break;
                 default:                  default:
                         bufncat(h, p, 2);                          bufncat(h, p, 2);

Legend:
Removed from v.1.151  
changed lines
  Added in v.1.154

CVSweb