groff
[Top][All Lists]
Advanced

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

[Groff] Re: grohtml vertical space patch and (screwdriver, nail and hamm


From: Gaius Mulley
Subject: [Groff] Re: grohtml vertical space patch and (screwdriver, nail and hammer fix)
Date: 23 Feb 2005 11:14:54 +0000
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Werner LEMBERG <address@hidden> writes:

> > I've fixed this bug and a few others (many vertical space bugs have
> > been quashed).
> 
> Right now I'm looking at my test output, pic.html, and I notice the
> following two problems:
> 
>   . Vertical space is missing right before a figure begins.
> 
>   . Vertical space is missing after a figure ends.
> 
> Can you fix this?  Otherwise the output is nice!

Hi Werner,

I believe I've fixed these bugs now, here are the patches:

Gaius


--- groff-cvs/src/devices/grohtml/html-text.cpp Mon Feb 21 14:25:17 2005
+++ groff-html/src/devices/grohtml/html-text.cpp        Mon Feb 21 14:34:20 2005
@@ -444,9 +444,11 @@
   done_tt();
   if (is_present(P_TAG)) {
     html_indent *i = remove_indent(P_TAG);
+    int space = retrieve_para_space();
     (void)done_para();
     if (! is_present(PRE_TAG))
       push_para(PRE_TAG, NULL, i);
+    start_space = space;
   } else if (! is_present(PRE_TAG))
     push_para(PRE_TAG, NULL, NULL);
   dump_stack();
@@ -709,8 +711,11 @@
 
 char *html_text::done_para (void)
 {
+  char *result;
   space_emitted = TRUE;
-  return shutdown(P_TAG);
+  result = shutdown(P_TAG);
+  start_space = FALSE;
+  return result;
 }
 
 /*
@@ -968,8 +973,9 @@
     while (p != NULL) {
       if (p->type == P_TAG && p->arg1 != NULL) {
        html_indent *i = remove_indent(P_TAG);
+       int          space = retrieve_para_space();
        done_para();
-       do_para("", i, space_emitted);
+       do_para("", i, space);
        return;
       }
       p = p->next;
--- groff-cvs/src/devices/grohtml/post-html.cpp Wed Feb 16 20:20:34 2005
+++ groff-html/src/devices/grohtml/post-html.cpp        Mon Feb 21 11:48:03 2005
@@ -2225,6 +2225,7 @@
     current_paragraph->done_para();
     next_tag        = INLINE;
     supress_sub_sup = TRUE;
+    seen_space      = FALSE;
     restore_troff_indent();
   }
 }
@@ -2834,6 +2835,7 @@
        seen_space = seen_space || current_paragraph->retrieve_para_space();
        current_paragraph->done_para();
        supress_sub_sup = TRUE;
+       current_paragraph->do_para("", seen_space);
       }
     end_center = next_center;
   }
--- groff-cvs/src/roff/troff/env.cpp    Thu Dec 16 13:09:54 2004
+++ groff-html/src/roff/troff/env.cpp   Wed Feb 23 12:10:13 2005
@@ -1130,7 +1130,16 @@
        error("environment stack underflow");
     }
     else {
+      int seen_space = curenv->seen_space;
+      int seen_eol   = curenv->seen_eol;
+      int suppress_next_eol = curenv->suppress_next_eol;
+
       curenv = env_stack->env;
+
+      curenv->seen_space = seen_space;
+      curenv->seen_eol   = seen_eol;
+      curenv->suppress_next_eol = suppress_next_eol;
+
       env_list *tem = env_stack;
       env_stack = env_stack->next;
       delete tem;
@@ -2300,6 +2309,8 @@
 void environment::construct_new_line_state(node *n)
 {
   if (is_html) {
+    node *t = n;
+
     // find first glyph node which has a state.
     while (n != 0 && n->state == 0)
       n = n->next;
--- groff-cvs/src/roff/troff/node.cpp   Thu Dec 16 13:09:54 2004
+++ groff-html/src/roff/troff/node.cpp  Fri Feb 18 12:35:33 2005
@@ -3903,6 +3903,7 @@
 suppress_node::suppress_node(symbol f, char p, int id)
 : is_on(2), emit_limits(0), filename(f), position(p), image_id(id)
 {
+  is_special = 1;
 }
 
 suppress_node::suppress_node(int issue_limits, int on_or_off,





reply via email to

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