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

Diff for /mandoc/html.c between version 1.243 and 1.244

version 1.243, 2018/11/23 19:17:05 version 1.244, 2018/11/26 01:38:23
Line 523  print_otag(struct html *h, enum htmltag tag, const cha
Line 523  print_otag(struct html *h, enum htmltag tag, const cha
         struct tag      *t;          struct tag      *t;
         const char      *attr;          const char      *attr;
         char            *arg1, *arg2;          char            *arg1, *arg2;
         int              tflags;          int              style_written, tflags;
   
         tflags = htmltags[tag].flags;          tflags = htmltags[tag].flags;
   
Line 563  print_otag(struct html *h, enum htmltag tag, const cha
Line 563  print_otag(struct html *h, enum htmltag tag, const cha
   
         va_start(ap, fmt);          va_start(ap, fmt);
   
         while (*fmt != '\0') {          while (*fmt != '\0' && *fmt != 's') {
   
                 /* Parse attributes and arguments. */                  /* Parse attributes and arguments. */
   
Line 579  print_otag(struct html *h, enum htmltag tag, const cha
Line 579  print_otag(struct html *h, enum htmltag tag, const cha
                 case 'i':                  case 'i':
                         attr = "id";                          attr = "id";
                         break;                          break;
                 case 's':  
                         attr = "style";  
                         arg2 = va_arg(ap, char *);  
                         break;  
                 case '?':                  case '?':
                         attr = arg1;                          attr = arg1;
                         arg1 = va_arg(ap, char *);                          arg1 = va_arg(ap, char *);
Line 622  print_otag(struct html *h, enum htmltag tag, const cha
Line 618  print_otag(struct html *h, enum htmltag tag, const cha
                         fmt++;                          fmt++;
                         break;                          break;
                 default:                  default:
                         if (arg2 == NULL)                          print_encode(h, arg1, NULL, 1);
                                 print_encode(h, arg1, NULL, 1);  
                         else {  
                                 print_word(h, arg1);  
                                 print_byte(h, ':');  
                                 print_byte(h, ' ');  
                                 print_word(h, arg2);  
                                 print_byte(h, ';');  
                         }  
                         break;                          break;
                 }                  }
                 print_byte(h, '"');                  print_byte(h, '"');
         }          }
   
           style_written = 0;
           while (*fmt++ == 's') {
                   arg1 = va_arg(ap, char *);
                   arg2 = va_arg(ap, char *);
                   if (arg2 == NULL)
                           continue;
                   print_byte(h, ' ');
                   if (style_written == 0) {
                           print_word(h, "style=\"");
                           style_written = 1;
                   }
                   print_word(h, arg1);
                   print_byte(h, ':');
                   print_byte(h, ' ');
                   print_word(h, arg2);
                   print_byte(h, ';');
           }
           if (style_written)
                   print_byte(h, '"');
   
         va_end(ap);          va_end(ap);
   
         /* Accommodate for "well-formed" singleton escaping. */          /* Accommodate for "well-formed" singleton escaping. */

Legend:
Removed from v.1.243  
changed lines
  Added in v.1.244

CVSweb