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 |
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) |
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 |
|
|