On Tue, 30 Nov 1999, W. L. Estes wrote:
> * add an explicit <br> before outputting a <pre> tag.
[snip]
> --- texinfo-4.0.orig/makeinfo/insertion.c Mon Jul 19 17:37:36 1999
> +++ texinfo-4.0/makeinfo/insertion.c Thu Nov 25 08:28:26 1999
> @@ -443,7 +443,7 @@ begin_insertion (type)
> /* Kludge alert: if <pre> is followed by a newline, IE3
> renders an extra blank line before the pre-formatted block.
> Other browsers seem to not mind one way or the other. */
> - add_word ("<pre>");
> + add_word ("<br><pre>");
Please explain why is this needed. There's a lot of obscure
undocumented behavior in the gray area between <br> and <pre> (e.g.,
see the comment right where you added <br>), so we'd better have a
good reason for such changes.
> name_arg = get_xref_token (1); /* expands all macros in image */
> - /* We don't (yet) care about any other args, but read them so they
> + /* We don't (yet) care about the next two args, but read them so they
> don't end up in the text. */
> rest = get_xref_token (0);
> if (rest)
> @@ -3022,25 +3022,39 @@ cm_image (arg)
> rest = get_xref_token (0);
> if (rest)
> free (rest);
> + alt_arg = get_xref_token (1); /* expands all macros in alt text */
> + ext_arg = get_xref_token (0);
Why did you call get_xref_token with a non-zero argument? All macros
were already expanded by the call which returns name_arg, see above,
so doing it again here is redundant.
> + if (*ext_arg)
> + {
> + sprintf (fullname, "%s.%s", name_arg, ext_arg);
> + if (access (fullname, R_OK) != 0)
I don't think sprintf is good enough: name_arg and ext_arg could have
special commands like @@, @value, etc. You need to expand them.
add_word_args that you use to output fullname doesn't do the
expansion; you need to use execute_string instead. Also, I think that
special characters in fullname should be HTML-escaped (you can use
e.g. escape_string for that).