From 3a54516f51ca75a102a97953cbc55299859488a8 Mon Sep 17 00:00:00 2001 From: Werner LEMBERG Date: Sun, 27 Feb 2005 06:26:15 +0000 Subject: [PATCH] * src/devices/grohtml/html-text.cpp (html_text::do_pre): Preserve paragraph spacing. (html_text::done_para): Unset `start_space'. (html_text::remove_para_align): Call `retrieve_para_space' for the spacing. * src/devices/grohtml/post-html.cpp (html_printer::emit_raw): Unset `seen_space'. (html_printer::do_check_center): Emit vertical space if necessary. * src/roff/troff/env.cpp (environment_switch): Preserve `seen_space', `seen_eol', and `suppress_next_eol' while switching environments. * src/roff/troff/node.cpp (suppress_node::suppress_node): Set `is_special'. --- ChangeLog | 19 +++++++++++++++++++ src/devices/grohtml/html-text.cpp | 10 ++++++++-- src/devices/grohtml/post-html.cpp | 2 ++ src/roff/troff/env.cpp | 8 +++++++- src/roff/troff/node.cpp | 3 ++- 5 files changed, 38 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8940fb85..20d34f6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2005-02-27 Gaius Mulley + + * src/devices/grohtml/html-text.cpp (html_text::do_pre): Preserve + paragraph spacing. + (html_text::done_para): Unset `start_space'. + (html_text::remove_para_align): Call `retrieve_para_space' for the + spacing. + + * src/devices/grohtml/post-html.cpp (html_printer::emit_raw): Unset + `seen_space'. + (html_printer::do_check_center): Emit vertical space if necessary. + + * src/roff/troff/env.cpp (environment_switch): Preserve + `seen_space', `seen_eol', and `suppress_next_eol' while switching + environments. + + * src/roff/troff/node.cpp (suppress_node::suppress_node): Set + `is_special'. + 2005-02-20 Werner LEMBERG * src/preproc/eqn/eqn.man, NEWS: Document various extensions of diff --git a/src/devices/grohtml/html-text.cpp b/src/devices/grohtml/html-text.cpp index 28f051ab..e4193443 100644 --- a/src/devices/grohtml/html-text.cpp +++ b/src/devices/grohtml/html-text.cpp @@ -444,9 +444,11 @@ void html_text::do_pre (void) 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 @@ void html_text::do_para (simple_output *op, const char *arg1, 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 @@ void html_text::remove_para_align (void) 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; diff --git a/src/devices/grohtml/post-html.cpp b/src/devices/grohtml/post-html.cpp index b66b7624..4f6fa212 100644 --- a/src/devices/grohtml/post-html.cpp +++ b/src/devices/grohtml/post-html.cpp @@ -2225,6 +2225,7 @@ void html_printer::emit_raw (text_glob *g) current_paragraph->done_para(); next_tag = INLINE; supress_sub_sup = TRUE; + seen_space = FALSE; restore_troff_indent(); } } @@ -2834,6 +2835,7 @@ void html_printer::do_check_center(void) 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; } diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp index a12239f5..3d4b4771 100644 --- a/src/roff/troff/env.cpp +++ b/src/roff/troff/env.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -1130,7 +1130,13 @@ void environment_switch() 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; diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp index 88be8651..80c6599c 100644 --- a/src/roff/troff/node.cpp +++ b/src/roff/troff/node.cpp @@ -1,5 +1,5 @@ // -*- C++ -*- -/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004 +/* Copyright (C) 1989, 1990, 1991, 1992, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. Written by James Clark (jjc@jclark.com) @@ -3903,6 +3903,7 @@ suppress_node::suppress_node(int on_or_off, int issue_limits) 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, -- 2.11.4.GIT