/[texinfo]/texinfo/makeinfo/html.c
ViewVC logotype

Diff of /texinfo/makeinfo/html.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by karl, Sat Oct 26 23:12:28 2002 UTC revision 1.5 by wl, Sun Oct 27 23:52:54 2002 UTC
# Line 174  insert_html_tag (start_or_end, tag) Line 174  insert_html_tag (start_or_end, tag)
174       int start_or_end;       int start_or_end;
175       char *tag;       char *tag;
176  {  {
177      char *old_tag = NULL;
178      int do_return = 0;
179    
180    if (!paragraph_is_open && (start_or_end == START))    if (!paragraph_is_open && (start_or_end == START))
181      {      {
182        /* Need to compensate for the <p> we are about to insert, or        /* Need to compensate for the <p> we are about to insert, or
# Line 183  insert_html_tag (start_or_end, tag) Line 186  insert_html_tag (start_or_end, tag)
186        add_word ("<p>");        add_word ("<p>");
187      }      }
188    
189    if (start_or_end == START)    if (start_or_end != START)
190      {      pop_tag (tag);
191        if (htmlstack  
192            && (strcmp (htmlstack->tag, tag) == 0))    if (htmlstack)
193          return;      old_tag = htmlstack->tag;
194      }  
195    else    if (htmlstack
196      {        && (strcmp (htmlstack->tag, tag) == 0))
197        if (htmlstack && htmlstack->next      do_return = 1;
           && (strcmp (htmlstack->next->tag, tag) == 0))  
         return;  
     }  
198    
199    if (start_or_end == START)    if (start_or_end == START)
200        push_tag (tag);
201    
202      if (do_return)
203        return;
204    
205      /* texinfo.tex doesn't support more than one font attribute
206         at the same time.  */
207      if ((start_or_end == START) && old_tag && *old_tag)
208      {      {
209        /* texinfo.tex doesn't support more than one font attribute        add_word ("</");
210           at the same time.  */        add_word (old_tag);
211        if (htmlstack && *(htmlstack->tag))        add_char ('>');
         {  
           add_word ("</");  
           add_word (htmlstack->tag);  
           add_char ('>');  
         }  
       push_tag (tag);  
212      }      }
213    
214    if (*tag)    if (*tag)
# Line 218  insert_html_tag (start_or_end, tag) Line 220  insert_html_tag (start_or_end, tag)
220        add_char ('>');        add_char ('>');
221      }      }
222    
223    if (start_or_end != START)    if ((start_or_end != START) && old_tag && *old_tag)
224      {      {
225        pop_tag ();        add_char ('<');
226        if (htmlstack && *(htmlstack->tag))        add_word (old_tag);
227          {        add_char ('>');
           add_char ('<');  
           add_word (htmlstack->tag);  
           add_char ('>');  
         }  
228      }      }
229  }  }
230    

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26