groff
[Top][All Lists]
Advanced

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

[Groff] Re: small patch to fix space bug in html headings + HR & LK


From: Gaius Mulley
Subject: [Groff] Re: small patch to fix space bug in html headings + HR & LK
Date: 17 Nov 2004 15:01:58 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Hi Werner,

here is another patch combined with the previous one included which
fixes the problem of generating rules around automatic heading links.

 ie:

.HR
.LK
.HR

strictly it does alter the behaviour of HR and LK which (no longer
force a `.br' and `.sp' in the case of HR for non html devices).  If
this is too big a change - I could always introduce two different HR
and LK macros..

any thoughts?

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 16:12:44 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();
@@ -2827,7 +2827,7 @@
 
 void html_printer::do_links (void)
 {
-  current_paragraph->done_para();
+  html.end_line();                      // flush line
   auto_links = FALSE;   /* from now on only emit under user request */
   file_list.add_new_file(xtmpfile());
   file_list.set_links_required();
--- groff-cvs/tmac/www.tmac     Tue Nov 16 12:48:50 2004
+++ groff-html/tmac/www.tmac    Wed Nov 17 16:24:01 2004
@@ -674,7 +674,7 @@
 .\"   section/numbered headings at this position.
 .\"
 .de LK
-.    HTML-TAG ".links"
+.    HTML-TAG-NS ".links"
 ..
 .\" --------------------------------------------------------------------
 .\" HR
@@ -682,12 +682,7 @@
 .\"   Produce a horizontal line
 .\"
 .de HR
-.  ie \\n[www-html] \{\
-.    ti 0
-.    HTML "<hr>"
-.  \}
-.  el \
-.    sp
+.  ie \\n[www-html] .HTML-NS "<hr>"
 ..
 .\" --------------------------------------------------------------------
 .\" NHR




reply via email to

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