bug-texinfo
[Top][All Lists]
Advanced

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

address@hidden: Bug#135463: texinfo: makeinfo --html: sectioning broken,


From: Josip Rodin
Subject: address@hidden: Bug#135463: texinfo: makeinfo --html: sectioning broken, patch attached]
Date: Sun, 24 Feb 2002 16:06:46 +0100
User-agent: Mutt/1.3.14i

----- Forwarded message from Tom Cato Amundsen <address@hidden> -----

Subject: Bug#135463: texinfo: makeinfo --html: sectioning broken, patch attached
Reply-To: Tom Cato Amundsen <address@hidden>, address@hidden
X-Debian-PR-Package: texinfo
Date: Sun, 24 Feb 2002 11:38:31 +0100
From: Tom Cato Amundsen <address@hidden>
To: Debian Bug Tracking System <address@hidden>

Package: texinfo
Version: 4.0f-1.01
Severity: normal
Tags: patch

Short description:
 @chapter command generate wrong html closing tag:
   <h2>chapter heading</h1>
It is problematic to use bad html like this in some html viewers, for
example XmHTML. You are free to decide if you will call this release
critical and patch the version in testing.


The following little texinfo file:

\input texinfo
@c %**start of header
@setfilename texibug.info
@settitle my settitle title
@c %**end of header

@chapter my chapter

text text text

...generates a wrong chapter heading:

<html lang="en">
<head>
<title>my settitle title</title>
<meta http-equiv="Content-Type" content="text/html">
<meta name=description content="my settitle title">
<meta name=generator content="makeinfo 4.0f">
<link href="http://texinfo.org/"; rel=generator-home>
</head>
<body>
<h1>my settitle title</h1>
<h2><a name="TOC0"></a>my chapter</h1>

<p>text text text

</body></html>


--- texinfo-4.0f/makeinfo/sectioning.c  Sat Jan 19 02:09:12 2002
+++ texinfo-4.0h/makeinfo/sectioning.c  Sat Feb  9 01:55:07 2002
@@ -1,5 +1,5 @@
 /* sectioning.c -- all related stuff @chapter, @section... @contents
-   $Id: sectioning.c,v 1.16 2002/01/19 01:09:08 karl Exp $
+   $Id: sectioning.c,v 1.17 2002/02/09 00:54:51 karl Exp $
 
    Copyright (C) 1999, 2001, 02 Free Software Foundation, Inc.
 
@@ -419,10 +419,16 @@
      the TOC could refer to.  */
   if (!current_node || !*current_node)
     {
+      static const char a_name[] = "<a name=\"";
+
       starting_pos = output_paragraph + output_paragraph_offset;
-      add_word_args ("<a name=\"TOC%d\"></a>", toc_ref_count++);
-      toc_anchor = substring (starting_pos + 9,
+      add_word_args ("%sTOC%d\">", a_name, toc_ref_count++);
+      toc_anchor = substring (starting_pos + sizeof (a_name) - 1,
                               output_paragraph + output_paragraph_offset);
+      /* This must be added after toc_anchor is extracted, since
+        toc_anchor cannot include the closing </a>.  For details,
+        see toc.c:toc_add_entry and toc.c:contents_update_html.  */
+      add_word ("</a>");
     }
   starting_pos = output_paragraph + output_paragraph_offset;
 
@@ -459,13 +465,13 @@
   if (section_alist[index].toc == TOC_YES)
     toc_add_entry (substring (starting_pos, ending_pos),
                    level, current_node, toc_anchor);
-  
+
   free (temp);
 
   if (outstanding_node)
     outstanding_node = 0;
 
-  add_word_args ("</h%d>", level+1);
+  add_word_args ("</h%d>", level + 2);
   close_paragraph();
   filling_enabled = 1;
   no_indent = old_no_indent;

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux debian 2.4.17 #1 Sat Dec 22 14:10:58 CET 2001 i686
Locale: LANG=english, LC_CTYPE=8859-1

Versions of packages texinfo depends on:
ii  libc6                         2.2.5-3    GNU C Library: Shared libraries an

-- 
Tom Cato Amundsen <address@hidden>
GNU Solfege - free eartraining, http://www.gnu.org/software/solfege/

----- End forwarded message -----

-- 
     2. That which causes joy or happiness.



reply via email to

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