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

Diff for /mandoc/html.c between version 1.139 and 1.140

version 1.139, 2011/05/15 15:47:46 version 1.140, 2011/05/17 10:48:06
Line 94  static const char *const htmlattrs[ATTR_MAX] = {
Line 94  static const char *const htmlattrs[ATTR_MAX] = {
         "colspan", /* ATTR_COLSPAN */          "colspan", /* ATTR_COLSPAN */
 };  };
   
   static  const char      *const roffscales[SCALE_MAX] = {
           "cm", /* SCALE_CM */
           "in", /* SCALE_IN */
           "pc", /* SCALE_PC */
           "pt", /* SCALE_PT */
           "em", /* SCALE_EM */
           "em", /* SCALE_MM */
           "ex", /* SCALE_EN */
           "ex", /* SCALE_BU */
           "em", /* SCALE_VS */
           "ex", /* SCALE_FS */
   };
   
 static  void              print_num(struct html *, const char *, size_t);  static  void              print_num(struct html *, const char *, size_t);
 static  void              print_spec(struct html *, const char *, size_t);  static  void              print_spec(struct html *, const char *, size_t);
 static  void              print_res(struct html *, const char *, size_t);  static  void              print_res(struct html *, const char *, size_t);
Line 729  void
Line 742  void
 bufcat_su(struct html *h, const char *p, const struct roffsu *su)  bufcat_su(struct html *h, const char *p, const struct roffsu *su)
 {  {
         double           v;          double           v;
         const char      *u;  
   
         v = su->scale;          v = su->scale;
           if (SCALE_MM == su->unit && 0.0 == (v /= 100.0))
                   v = 1.0;
   
         switch (su->unit) {          buffmt(h, "%s: %.2f%s;", p, v, roffscales[su->unit]);
         case (SCALE_CM):  
                 u = "cm";  
                 break;  
         case (SCALE_IN):  
                 u = "in";  
                 break;  
         case (SCALE_PC):  
                 u = "pc";  
                 break;  
         case (SCALE_PT):  
                 u = "pt";  
                 break;  
         case (SCALE_EM):  
                 u = "em";  
                 break;  
         case (SCALE_MM):  
                 if (0 == (v /= 100))  
                         v = 1;  
                 u = "em";  
                 break;  
         case (SCALE_EN):  
                 u = "ex";  
                 break;  
         case (SCALE_BU):  
                 u = "ex";  
                 break;  
         case (SCALE_VS):  
                 u = "em";  
                 break;  
         default:  
                 u = "ex";  
                 break;  
         }  
   
         /*  
          * XXX: the CSS spec isn't clear as to which types accept  
          * integer or real numbers, so we just make them all decimals.  
          */  
         buffmt(h, "%s: %.2f%s;", p, v, u);  
 }  }
   
   

Legend:
Removed from v.1.139  
changed lines
  Added in v.1.140

CVSweb