groff
[Top][All Lists]
Advanced

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

[Groff] small patch to fix space bug in html headings


From: Gaius Mulley
Subject: [Groff] small patch to fix space bug in html headings
Date: Wed, 17 Nov 2004 12:59:47 +0000

Hi Werner,

again thanks for reporting the bug you found while creating the
neat new web page. Here is a patch which fixes the problem,

Gaius

--- groff-cvs/src/devices/grohtml/post-html.cpp Sat Oct 30 12:11:00 2004
+++ groff-html/src/devices/grohtml/post-html.cpp        Wed Nov 17 14:37:10 2004
@@ -2489,23 +2489,23 @@
 void html_printer::do_heading (char *arg)
 {
   text_glob *g;
-  text_glob *l = 0;
   int  level=atoi(arg);
+  int  horiz;
 
   header.header_buffer.clear();
   page_contents->glyphs.move_right();
   if (! page_contents->glyphs.is_equal_to_head()) {
     g = page_contents->glyphs.get_data();
+    horiz = g->minh;
     do {
       if (g->is_auto_img()) {
        string img=generate_img_src((char *)(g->text_string + 20));
 
        if (! img.empty()) {
          simple_anchors = TRUE;  // we cannot use full heading anchors with 
images
-         if (l != 0)
+         if (horiz < g->minh)
            header.header_buffer += " ";
          
-         l = g;
          header.header_buffer += img;
        }
       }
@@ -2519,10 +2519,10 @@
        /*
         *  we ignore the other tag commands when constructing a heading
         */
-       if (l != 0)
+       if (horiz < g->minh)
          header.header_buffer += " ";
-       l = g;
 
+       horiz = g->maxh;
        header.header_buffer += string(g->text_string, g->text_length);
       }
       page_contents->glyphs.move_right();




reply via email to

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