From: Bob D. <bd...@si...> - 2005-05-13 15:17:20
|
Applied Ty! - bob On Fri, 2005-05-13 at 10:09 -0400, Shannon Weyrick wrote: > Hi, > > This patch implements a new a parameter for suppressing <head> and > <body> tag at the start of an HTML report. This is necessary when the > report will be embedded in another web page. > > Shannon > plain text document attachment (html.diff) > Index: html.c > =================================================================== > RCS file: /cvsroot/rlib/rlib/libsrc/html.c,v > retrieving revision 1.57 > diff -u -r1.57 html.c > --- html.c 2 May 2005 18:21:43 -0000 1.57 > +++ html.c 13 May 2005 14:10:22 -0000 > @@ -339,6 +339,7 @@ > gchar buf[MAXSTRLEN]; > gchar *meta; > gchar *link; > + gchar *suppress_head; > gint pages_across = part->pages_across; > > OUTPUT_PRIVATE(r)->top = g_new0(GSList *, pages_across); > @@ -347,21 +348,29 @@ > link = g_hash_table_lookup(r->output_parameters, "trim_links"); > if(link != NULL) > OUTPUT(r)->trim_links = TRUE; > - sprintf(buf, "<head>\n<style type=\"text/css\">\n"); > - print_text(r, buf, FALSE); > - sprintf(buf, "pre { margin:0; padding:0; margin-top:0; margin-bottom:0;}\n"); > - print_text(r, buf, FALSE); > - print_text(r, "DIV { position: absolute; left: 0; }\n", FALSE); > - print_text(r, "TABLE { border: 0; cellspacing: 0; cellpadding: 0; width: 100%; }\n", FALSE); > - print_text(r, "</style>\n", FALSE); > - > - meta = g_hash_table_lookup(r->output_parameters, "meta"); > - if(meta != NULL) > - print_text(r, meta, FALSE); > - > - print_text(r, "</head>\n", FALSE); > - > - print_text(r, "<body><table><tr><td><pre>", FALSE); > + > + suppress_head = g_hash_table_lookup(r->output_parameters, "suppress_head"); > + if(suppress_head == NULL) { > + > + sprintf(buf, "<head>\n<style type=\"text/css\">\n"); > + print_text(r, buf, FALSE); > + sprintf(buf, "pre { margin:0; padding:0; margin-top:0; margin-bottom:0;}\n"); > + print_text(r, buf, FALSE); > + print_text(r, "DIV { position: absolute; left: 0; }\n", FALSE); > + print_text(r, "TABLE { border: 0; cellspacing: 0; cellpadding: 0; width: 100%; }\n", FALSE); > + print_text(r, "</style>\n", FALSE); > + > + meta = g_hash_table_lookup(r->output_parameters, "meta"); > + if(meta != NULL) > + print_text(r, meta, FALSE); > + > + print_text(r, "</head>\n", FALSE); > + print_text(r, "<body>\n", FALSE); > + > + } > + > + print_text(r, "<table><tr><td><pre>", FALSE); > + > } > > static void rlib_html_end_part(rlib *r, struct rlib_part *part) { |