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

Diff for /mandoc/html.c between version 1.235 and 1.236

version 1.235, 2018/06/25 13:45:57 version 1.236, 2018/06/25 14:00:28
Line 120  static const char *const roffscales[SCALE_MAX] = {
Line 120  static const char *const roffscales[SCALE_MAX] = {
 /* Avoid duplicate HTML id= attributes. */  /* Avoid duplicate HTML id= attributes. */
 static  struct ohash     id_unique;  static  struct ohash     id_unique;
   
 static  void     a2width(const char *, struct roffsu *);  
 static  void     print_byte(struct html *, char);  static  void     print_byte(struct html *, char);
 static  void     print_endword(struct html *);  static  void     print_endword(struct html *);
 static  void     print_indent(struct html *);  static  void     print_indent(struct html *);
Line 687  print_otag(struct html *h, enum htmltag tag, const cha
Line 686  print_otag(struct html *h, enum htmltag tag, const cha
                 case 'u':                  case 'u':
                         su = va_arg(ap, struct roffsu *);                          su = va_arg(ap, struct roffsu *);
                         break;                          break;
                 case 'w':  
                         if ((arg2 = va_arg(ap, char *)) != NULL) {  
                                 su = &mysu;  
                                 a2width(arg2, su);  
                         }  
                         if (*fmt == '+') {  
                                 if (su != NULL) {  
                                         /* Make even bold text fit. */  
                                         su->scale *= 1.2;  
                                         /* Add padding. */  
                                         su->scale += 3.0;  
                                 }  
                                 fmt++;  
                         }  
                         break;  
                 default:                  default:
                         abort();                          abort();
                 }                  }
Line 715  print_otag(struct html *h, enum htmltag tag, const cha
Line 699  print_otag(struct html *h, enum htmltag tag, const cha
                 case 'l':                  case 'l':
                         attr = "margin-left";                          attr = "margin-left";
                         break;                          break;
                 case 'w':  
                         attr = "width";  
                         break;  
                 case 'W':  
                         attr = "min-width";  
                         break;  
                 case '?':                  case '?':
                         attr = arg1;                          attr = arg1;
                         arg1 = va_arg(ap, char *);                          arg1 = va_arg(ap, char *);
Line 1034  print_word(struct html *h, const char *cp)
Line 1012  print_word(struct html *h, const char *cp)
 {  {
         while (*cp != '\0')          while (*cp != '\0')
                 print_byte(h, *cp++);                  print_byte(h, *cp++);
 }  
   
 /*  
  * Calculate the scaling unit passed in a `-width' argument.  This uses  
  * either a native scaling unit (e.g., 1i, 2m) or the string length of  
  * the value.  
  */  
 static void  
 a2width(const char *p, struct roffsu *su)  
 {  
         const char      *end;  
   
         end = a2roffsu(p, su, SCALE_MAX);  
         if (end == NULL || *end != '\0') {  
                 su->unit = SCALE_EN;  
                 su->scale = html_strlen(p);  
         } else if (su->scale < 0.0)  
                 su->scale = 0.0;  
 }  }

Legend:
Removed from v.1.235  
changed lines
  Added in v.1.236

CVSweb