Index: doc/groff.texinfo
===================================================================
RCS file: /sources/groff/groff/doc/groff.texinfo,v
retrieving revision 1.256
diff -r1.256 groff.texinfo
6461a6462,6471
> @item \n[.O]
> @vindex .O
> This read only register is set to the suppression nesting level (see
> escapes @code{\O} @xref{Suppressing output}.
>
> @tie{}1 (and to@tie{}0 otherwise) if the current
> page is actually being printed, i.e., if the @option{-o} option is being
> used to only print selected pages. @xref{Groff Options}, for more
> information.
>
12839a12850,12851
> The current level is contained within the read only register @code{.O}
> @xref{Built-in Registers}.
12842a12855,12856
> The current level is contained within the read only register @code{.O}
> @xref{Built-in Registers}.
Index: src/devices/grohtml/grohtml.man
===================================================================
RCS file: /sources/groff/groff/src/devices/grohtml/grohtml.man,v
retrieving revision 1.23
diff -r1.23 grohtml.man
243a244,247
> .TP
> .B \-V
> create a xhtml validator button at the bottom of each page of the document.
> .
Index: src/devices/grohtml/html-table.cpp
===================================================================
RCS file: /sources/groff/groff/src/devices/grohtml/html-table.cpp,v
retrieving revision 1.6
diff -r1.6 html-table.cpp
340c340
< .put_string(" border=0 rules=\"none\" frame=\"void\"\n")
---
> .put_string(" border=\"0\" rules=\"none\" frame=\"void\"\n")
480c480
< out->put_string("").nl();
---
> out->put_string("").nl();
Index: src/devices/grohtml/html-text.cpp
===================================================================
RCS file: /sources/groff/groff/src/devices/grohtml/html-text.cpp,v
retrieving revision 1.9
diff -r1.9 html-text.cpp
47,50c47,51
< html_text::html_text (simple_output *op) :
< stackptr(NULL), lastptr(NULL), out(op), space_emitted(TRUE),
< current_indentation(-1), pageoffset(-1), linelength(-1),
< blank_para(TRUE), start_space(FALSE)
---
> html_text::html_text (simple_output *op, html_dialect d) :
> stackptr(NULL), lastptr(NULL), out(op), dialect(d),
> space_emitted(TRUE), current_indentation(-1),
> pageoffset(-1), linelength(-1), blank_para(TRUE),
> start_space(FALSE)
198a200
> #if 0
200a203
> #endif
655c658
< if (is_present(PRE_TAG)) {
---
> if (is_present(PRE_TAG))
657c660,662
< } else
---
> else if (dialect == xhtml)
> out->put_string("
").nl();
> else
Index: src/devices/grohtml/html-text.h
===================================================================
RCS file: /sources/groff/groff/src/devices/grohtml/html-text.h,v
retrieving revision 1.14
diff -r1.14 html-text.h
34a35,40
> * supported html dialects.
> */
>
> typedef enum {xhtml, html4} html_dialect;
>
> /*
59c65
< html_text (simple_output *op);
---
> html_text (simple_output *op, html_dialect d);
107a114
> html_dialect dialect; /* which dialect of html? */
Index: src/devices/grohtml/post-html.cpp
===================================================================
RCS file: /sources/groff/groff/src/devices/grohtml/post-html.cpp,v
retrieving revision 1.38
diff -r1.38 post-html.cpp
92a93,95
> static html_dialect dialect = html4; /* which html dialect should grohtml output */
> static int valid_flag = FALSE; /* has user requested a valid flag at the */
> /* end of each page? */
1592c1595,1599
< fputs("
\n", f);
---
> fputs("", f);
> if (dialect == xhtml)
> fputs("
\n", f);
> else
> fputs("
\n", f);
2093a2101,2102
> void handle_valid_flag (void);
> void do_math (text_glob *g);
2170c2179,2182
< html.put_string("
");
---
> if (dialect == xhtml)
> html.put_string("
");
> else
> html.put_string("
");
2209c2221
< current_paragraph->do_para("align=center", space);
---
> current_paragraph->do_para("align=\"center\"", space);
2212c2224
< current_paragraph->do_para(&html, "align=left", get_troff_indent(), pageoffset, linelength, space);
---
> current_paragraph->do_para(&html, "align=\"left\"", get_troff_indent(), pageoffset, linelength, space);
2215c2227
< current_paragraph->do_para(&html, "align=right", get_troff_indent(), pageoffset, linelength, space);
---
> current_paragraph->do_para(&html, "align=\"right\"", get_troff_indent(), pageoffset, linelength, space);
2313c2325
< + "alt=\"Image " + filename + "\">";
---
> + "alt=\"Image " + filename + "\">";
2813c2825
< current_paragraph->do_para("align=center", space);
---
> current_paragraph->do_para("align=\"center\"", space);
2815c2827
< if (strcmp("align=center",
---
> if (strcmp("align=\"center\"",
2824c2836
< current_paragraph->do_para("align=center", space);
---
> current_paragraph->do_para("align=\"center\"", space);
2901c2913,2916
< split_file += string(".html");
---
> if (dialect == xhtml)
> split_file += string(".xhtml");
> else
> split_file += string(".html");
3095d3109
<
3097a3112,3118
> } else if (strncmp(g->text_string, "html:", strlen("html:")) == 0) {
> if (current_paragraph->emitted_text())
> html.put_string(g->text_string+9);
> else
> do_end_para(g);
> } else if (strncmp(g->text_string, "math:", strlen("math:")) == 0) {
> do_math(g);
3179a3201,3215
> * do_math - prints out the equation
> */
>
> void html_printer::do_math (text_glob *g)
> {
> int l = strlen("math:");
>
> do_font(g);
> if (current_paragraph->emitted_text())
> html.put_string(g->text_string+9);
> else
> do_end_para(g);
> }
>
> /*
4723c4759,4762
< html.put_string("");
---
> if (dialect == xhtml)
> html.put_string("");
> else
> html.put_string("");
4740,4741c4779,4784
< if (auto_rule)
< fputs("
\n", stdout);
---
> if (auto_rule) {
> if (dialect == xhtml)
> fputs("
\n", stdout);
> else
> fputs("
\n", stdout);
> }
4760c4803
< current_paragraph = new html_text(&html);
---
> current_paragraph = new html_text(&html, dialect);
4835a4879
> handle_valid_flag();
4860c4904,4907
< top += string(".html");
---
> if (dialect == xhtml)
> top += string(".xhtml");
> else
> top += string(".html");
4894c4941
< else
---
> else {
4895a4943,4947
> if (valid_flag && dialect == xhtml) {
> handle_valid_flag();
> write_rule();
> }
> }
4905,4915c4957,4982
< fputs("\n", stdout);
<
< fputs("\n", stdout);
< fputs("\n", stdout);
< fputs("\n", stdout);
< fputs("\n", stdout);
< fputs("\n", stdout);
<
---
> if (dialect == html4) {
> fputs(" fputs("\"http://www.w3.org/TR/html4/loose.dtd\">\n", stdout);
> fputs("\n", stdout);
> fputs("\n", stdout);
> fputs(" "content=\"groff -Thtml, see www.gnu.org\">\n", stdout);
> fputs(" "content=\"text/html; charset=US-ASCII\">\n", stdout);
> fputs("\n", stdout);
> }
> else {
> fputs("\n", stdout);
> fputs(" fputs(" \"http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd\"\n", stdout);
> fputs(" []>\n", stdout);
>
> fputs("\n",
> stdout);
> fputs("\n", stdout);
> fputs(" "content=\"groff -Txhtml, see www.gnu.org\"/>\n", stdout);
> fputs(" "content=\"text/html; charset=US-ASCII\"/>\n", stdout);
> fputs("\n", stdout);
> }
4917,4919c4984,4989
< fputs(" p { margin-top: 0; margin-bottom: 0; }\n", stdout);
< fputs(" pre { margin-top: 0; margin-bottom: 0; }\n", stdout);
< fputs(" table { margin-top: 0; margin-bottom: 0; }\n", stdout);
---
> fputs(" p { margin-top: 0; margin-bottom: 0; "
> "vertical-align=\"top\" }\n", stdout);
> fputs(" pre { margin-top: 0; margin-bottom: 0; "
> "vertical-align=\"top\" }\n", stdout);
> fputs(" table { margin-top: 0; margin-bottom: 0; "
> "vertical-align=\"top\" }\n", stdout);
4934a5005,5008
>
> if (dialect == xhtml)
> writeHeadMetaStyle();
>
4946c5020,5021
< writeHeadMetaStyle();
---
> if (dialect == html4)
> writeHeadMetaStyle();
5126c5201,5203
< } else if (strncmp(s, "html:", 9) == 0) {
---
> } else if ((strncmp(s, "html:", 9) == 0) ||
> (strncmp(s, "html:", 9) == 0) ||
> (strncmp(s, "math:", 9) == 0)) {
5128a5206
> string t;
5135a5214,5224
> if (strncmp(s, "math:", 9) == 0) {
> if (strncmp((char *)&s[9], "