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

Diff for /mandoc/html.c between version 1.251 and 1.252

version 1.251, 2019/01/11 12:56:42 version 1.252, 2019/01/18 14:36:21
Line 271  html_close_paragraph(struct html *h)
Line 271  html_close_paragraph(struct html *h)
 {  {
         struct tag      *t;          struct tag      *t;
   
         for (t = h->tag; t != NULL; t = t->next) {          for (t = h->tag; t != NULL && t->closed == 0; t = t->next) {
                 if (t->tag == TAG_P || t->tag == TAG_PRE) {                  switch(t->tag) {
                   case TAG_P:
                   case TAG_PRE:
                         print_tagq(h, t);                          print_tagq(h, t);
                         break;                          break;
                   case TAG_A:
                           print_tagq(h, t);
                           continue;
                   default:
                           continue;
                 }                  }
                   break;
         }          }
 }  }
   
Line 579  print_otag(struct html *h, enum htmltag tag, const cha
Line 587  print_otag(struct html *h, enum htmltag tag, const cha
                 t = mandoc_malloc(sizeof(struct tag));                  t = mandoc_malloc(sizeof(struct tag));
                 t->tag = tag;                  t->tag = tag;
                 t->next = h->tag;                  t->next = h->tag;
                   t->refcnt = 0;
                   t->closed = 0;
                 h->tag = t;                  h->tag = t;
         } else          } else
                 t = NULL;                  t = NULL;
Line 711  print_ctag(struct html *h, struct tag *tag)
Line 721  print_ctag(struct html *h, struct tag *tag)
 {  {
         int      tflags;          int      tflags;
   
         /*          if (tag->closed == 0) {
          * Remember to close out and nullify the current                  tag->closed = 1;
          * meta-font and table, if applicable.                  if (tag == h->metaf)
          */                          h->metaf = NULL;
         if (tag == h->metaf)                  if (tag == h->tblt)
                 h->metaf = NULL;                          h->tblt = NULL;
         if (tag == h->tblt)  
                 h->tblt = NULL;  
   
         tflags = htmltags[tag->tag].flags;                  tflags = htmltags[tag->tag].flags;
                   if (tflags & HTML_INDENT)
         if (tflags & HTML_INDENT)                          h->indent--;
                 h->indent--;                  if (tflags & HTML_NOINDENT)
         if (tflags & HTML_NOINDENT)                          h->noindent--;
                 h->noindent--;                  if (tflags & HTML_NLEND)
         if (tflags & HTML_NLEND)                          print_endline(h);
                 print_endline(h);                  print_indent(h);
         print_indent(h);                  print_byte(h, '<');
         print_byte(h, '<');                  print_byte(h, '/');
         print_byte(h, '/');                  print_word(h, htmltags[tag->tag].name);
         print_word(h, htmltags[tag->tag].name);                  print_byte(h, '>');
         print_byte(h, '>');                  if (tflags & HTML_NLAFTER)
         if (tflags & HTML_NLAFTER)                          print_endline(h);
                 print_endline(h);          }
           if (tag->refcnt == 0) {
         h->tag = tag->next;                  h->tag = tag->next;
         free(tag);                  free(tag);
           }
 }  }
   
 void  void
Line 824  print_text(struct html *h, const char *word)
Line 833  print_text(struct html *h, const char *word)
 void  void
 print_tagq(struct html *h, const struct tag *until)  print_tagq(struct html *h, const struct tag *until)
 {  {
         struct tag      *tag;          struct tag      *this, *next;
   
         while ((tag = h->tag) != NULL) {          for (this = h->tag; this != NULL; this = next) {
                 print_ctag(h, tag);                  next = this == until ? NULL : this->next;
                 if (tag == until)                  print_ctag(h, this);
                         return;  
         }          }
 }  }
   
Line 841  print_tagq(struct html *h, const struct tag *until)
Line 849  print_tagq(struct html *h, const struct tag *until)
 void  void
 print_stagq(struct html *h, const struct tag *suntil)  print_stagq(struct html *h, const struct tag *suntil)
 {  {
         struct tag      *tag;          struct tag      *this, *next;
   
         while ((tag = h->tag) != NULL) {          for (this = h->tag; this != NULL; this = next) {
                 if (tag == suntil ||                  next = this->next;
                     (tag->next == suntil &&                  if (this == suntil || (next == suntil &&
                      (tag->tag == TAG_P || tag->tag == TAG_PRE)))                      (this->tag == TAG_P || this->tag == TAG_PRE)))
                         return;                          break;
                 print_ctag(h, tag);                  print_ctag(h, this);
         }          }
 }  }
   

Legend:
Removed from v.1.251  
changed lines
  Added in v.1.252

CVSweb