texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/makeinfo index.c,1.14,1.15


From: dirt
Subject: texinfo/makeinfo index.c,1.14,1.15
Date: Thu, 19 Feb 2004 16:10:42 +0100

Update of /cvsroot/texinfo/texinfo/makeinfo
In directory sheep:/tmp/cvs-serv27587/makeinfo

Modified Files:
        index.c 
Log Message:
2004-02-19  Alper Ersoy  <address@hidden>

        * makeinfo/index.c (index_add_arg): create an anchor where @index is
        used in HTML documents.
        (cm_printindex): make index text an hyperlink to the created anchor.



Index: index.c
===================================================================
RCS file: /cvsroot/texinfo/texinfo/makeinfo/index.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** index.c     13 Feb 2004 22:01:38 -0000      1.14
--- index.c     19 Feb 2004 15:10:40 -0000      1.15
***************
*** 206,210 ****
--- 206,233 ----
                   new->entry_text);
  #endif
+ 
+       if (html)
+         {
+           /* Anchor.  */
+           int removed_empty_elt = 0;
+ 
+           if (rollback_empty_tag ("dl"))
+             removed_empty_elt = 1;
+           else if (rollback_empty_tag ("ul"))
+             removed_empty_elt = 2;
+ 
+           add_word_args ("<a name=\"index-%s-", name);
+           add_anchor_name (new->node, 0);
+           add_char ('-');
+           add_anchor_name (index_entry, 0);
+           add_word_args ("\"></a>");
+ 
+           if (removed_empty_elt == 1)
+             add_html_block_elt_args ("\n<dl>");
+           else if (removed_empty_elt == 2)
+             add_html_block_elt_args ("\n<ul>");
+         }
      }
+ 
    if (xml)
      xml_insert_indexterm (index_entry, name);
***************
*** 770,793 ****
             have to find something to wrap the anchor around). */
              {
!               if (last_index
!                   && STREQ (last_index->entry_text, index->entry_text))
!                 add_word (", ");  /* Don't repeat the previous entry. */
!               else
!                 {
!                   /* In the HTML case, the expanded index entry is not
!                      good for us, since it was expanded for non-HTML mode
!                      inside sort_index.  So we need to HTML-escape and
!                      expand the original entry text here.  */
!                   char *escaped_entry = xstrdup (index->entry_text);
!                   char *expanded_entry;
  
-                   /* expansion() doesn't HTML-escape the argument, so need
-                      to do it separately.  */
-                   escaped_entry = escape_string (escaped_entry);
-                   expanded_entry = expansion (escaped_entry, index->code);
-                   add_word_args ("\n<li>%s: ", expanded_entry);
-                   free (escaped_entry);
-                   free (expanded_entry);
-                 }
                add_word ("<a href=\"");
                if (index->node && *index->node)
--- 793,815 ----
             have to find something to wrap the anchor around). */
              {
!               /* In the HTML case, the expanded index entry is not
!                  good for us, since it was expanded for non-HTML mode
!                  inside sort_index.  So we need to HTML-escape and
!                  expand the original entry text here.  */
!               char *escaped_entry = xstrdup (index->entry_text);
!               char *expanded_entry;
! 
!               /* expansion() doesn't HTML-escape the argument, so need
!                  to do it separately.  */
!               escaped_entry = escape_string (escaped_entry);
!               expanded_entry = expansion (escaped_entry, index->code);
!               add_word_args ("\n<li><a href=\"#index-%s-", index_name);
!               add_anchor_name (index->node, 0);
!               add_char ('-');
!               add_anchor_name (index->entry_text, 0);
!               add_word_args ("\">%s</a>: ", expanded_entry);
!               free (escaped_entry);
!               free (expanded_entry);
  
                add_word ("<a href=\"");
                if (index->node && *index->node)



reply via email to

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