bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: makeinfo (version 4.8) --html ignores @shortcaption


From: Karl Berry
Subject: Re: makeinfo (version 4.8) --html ignores @shortcaption
Date: Thu, 25 Jan 2007 18:41:15 -0600

Hi Jay,

    makeinfo --html --no-split a.texinfo
    lists the caption rather than the short caption in the list of

It seems the original implementation intentionally did that, among other
odd behavior.  It seems best to me to just always use the short caption,
since that's the intent, so I changed it.  Please try this patch if you
can (now in CVS).

Thanks for the report,
Karl

--- float.c.~1.9.~      2005-05-14 17:00:07.000000000 -0700
+++ float.c     2007-01-25 15:58:18.000000000 -0800
@@ -220,4 +220,12 @@
           if (strlen (temp->id) > 0 && STREQ (float_type, temp->type))
             {
+              char *caption;
+              if (strlen (temp->shorttitle) > 0)
+                caption = expansion (temp->shorttitle, 0);
+              else if (strlen (temp->title) > 0)
+                caption = expansion (temp->title, 0);
+              else
+                caption = "";
+                  
               if (html)
                 {
@@ -243,11 +251,9 @@
                     }
 
-                  if (strlen (temp->title) > 0)
+                  if (caption)
                     {
-                      if (strlen (float_type) > 0
-                          || strlen (temp->id) > 0)
+                      if (strlen (float_type) > 0 || strlen (temp->id) > 0)
                         insert_string (": ");
-
-                      execute_string ("%s", temp->title);
+                      execute_string ("%s", caption);
                     }
 
@@ -260,5 +266,4 @@
                   char *entry;
                   char *raw_entry;
-                  char *title = expansion (temp->title, 0);
 
                   int len;
@@ -286,23 +291,17 @@
                   /* Allocate enough space for possible expansion later.  */
                   raw_entry = (char *) xmalloc (strlen (float_type)
-                      + strlen (temp->number) + strlen (title)
+                      + strlen (temp->number) + strlen (caption)
                       + sizeof (":  "));
 
                   sprintf (raw_entry, "%s %s", float_type, temp->number);
 
-                  if (strlen (title) > 0)
+                  if (strlen (caption) > 0)
                     strcat (raw_entry, ": ");
 
                   number_len = strlen (raw_entry);
 
-                  len = strlen (title) + strlen (raw_entry);
-
-                  /* If we have a @shortcaption, try it if @caption is
-                     too long to fit on a line.  */
-                  if (len + aux_chars_len > column_width
-                      && strlen (temp->shorttitle) > 0)
-                    title = expansion (temp->shorttitle, 0);
+                  len = strlen (caption) + strlen (raw_entry);
 
-                  strcat (raw_entry, title);
+                  strcat (raw_entry, caption);
                   len = strlen (raw_entry);
 
@@ -325,5 +324,5 @@
                          as possible of the title.  */
                       if (len == 0
-                          || (len == number_len && strlen (title) > 0))
+                          || (len == number_len && strlen (caption) > 0))
                         len = column_width - sizeof ("...");
 
@@ -394,6 +393,8 @@
 
                   free (entry);
-                  free (title);
                 }
+              
+              if (strlen (caption) > 0)
+                free (caption);
             }
           temp = temp->next;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]