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

Diff for /mandoc/html.c between version 1.121 and 1.122

version 1.121, 2010/12/22 11:15:16 version 1.122, 2010/12/24 00:46:49
Line 74  static const struct htmldata htmltags[TAG_MAX] = {
Line 74  static const struct htmldata htmltags[TAG_MAX] = {
         {"i",           0 }, /* TAG_I */          {"i",           0 }, /* TAG_I */
         {"u",           0 }, /* TAG_U */          {"u",           0 }, /* TAG_U */
         {"code",        0 }, /* TAG_CODE */          {"code",        0 }, /* TAG_CODE */
           {"small",       0 }, /* TAG_SMALL */
 };  };
   
 static  const char      *const htmlfonts[HTMLFONT_MAX] = {  
         "roman",  
         "bold",  
         "italic"  
 };  
   
 static  const char      *const htmlattrs[ATTR_MAX] = {  static  const char      *const htmlattrs[ATTR_MAX] = {
         "http-equiv", /* ATTR_HTTPEQUIV */          "http-equiv", /* ATTR_HTTPEQUIV */
         "content", /* ATTR_CONTENT */          "content", /* ATTR_CONTENT */
Line 257  print_res(struct html *h, const char *p, size_t len)
Line 252  print_res(struct html *h, const char *p, size_t len)
 }  }
   
   
 struct tag *  
 print_ofont(struct html *h, enum htmlfont font)  
 {  
         struct htmlpair  tag;  
   
         h->metal = h->metac;  
         h->metac = font;  
   
         /* FIXME: DECO_ROMAN should just close out preexisting. */  
   
         if (h->metaf && h->tags.head == h->metaf)  
                 print_tagq(h, h->metaf);  
   
         PAIR_CLASS_INIT(&tag, htmlfonts[font]);  
         h->metaf = print_otag(h, TAG_SPAN, 1, &tag);  
         return(h->metaf);  
 }  
   
   
 static void  static void
 print_metaf(struct html *h, enum roffdeco deco)  print_metaf(struct html *h, enum roffdeco deco)
 {  {
Line 299  print_metaf(struct html *h, enum roffdeco deco)
Line 275  print_metaf(struct html *h, enum roffdeco deco)
                 /* NOTREACHED */                  /* NOTREACHED */
         }          }
   
         (void)print_ofont(h, font);          if (h->metaf) {
                   print_tagq(h, h->metaf);
                   h->metaf = NULL;
           }
   
           h->metal = h->metac;
           h->metac = font;
   
           if (HTMLFONT_NONE != font)
                   h->metaf = HTMLFONT_BOLD == font ?
                           print_otag(h, TAG_B, 0, NULL) :
                           print_otag(h, TAG_I, 0, NULL);
 }  }
   
   
Line 554  print_text(struct html *h, const char *word)
Line 541  print_text(struct html *h, const char *word)
                         printf(" ");                          printf(" ");
         }          }
   
           assert(NULL == h->metaf);
           if (HTMLFONT_NONE != h->metac)
                   h->metaf = HTMLFONT_BOLD == h->metac ?
                           print_otag(h, TAG_B, 0, NULL) :
                           print_otag(h, TAG_I, 0, NULL);
   
         assert(word);          assert(word);
         if ( ! print_encode(h, word, 0))          if ( ! print_encode(h, word, 0))
                 if ( ! (h->flags & HTML_NONOSPACE))                  if ( ! (h->flags & HTML_NONOSPACE))
                         h->flags &= ~HTML_NOSPACE;                          h->flags &= ~HTML_NOSPACE;
   
           if (h->metaf) {
                   print_tagq(h, h->metaf);
                   h->metaf = NULL;
           }
   
         h->flags &= ~HTML_IGNDELIM;          h->flags &= ~HTML_IGNDELIM;
   

Legend:
Removed from v.1.121  
changed lines
  Added in v.1.122

CVSweb