summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2017-01-19 13:35:00 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2017-01-19 13:35:00 +0000
commitbf424eede316da34b41e9ee8ad9490cb7fbcbe31 (patch)
tree0ddcd6ae34086d1df44df7aa8be3cfef904cba54
parenta416a056fff15d472930cf429a7fa0b99d9f1721 (diff)
Start cleanup: trim useless HTML comments and <div> elements
on the <html> and <body> levels.
-rw-r--r--usr.bin/mandoc/cgi.c15
-rw-r--r--usr.bin/mandoc/man_html.c18
-rw-r--r--usr.bin/mandoc/mdoc_html.c18
3 files changed, 21 insertions, 30 deletions
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c
index e168f42e577..90e13441214 100644
--- a/usr.bin/mandoc/cgi.c
+++ b/usr.bin/mandoc/cgi.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: cgi.c,v 1.80 2016/09/11 23:59:02 bentley Exp $ */
+/* $OpenBSD: cgi.c,v 1.81 2017/01/19 13:34:59 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@usta.de>
+ * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@usta.de>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -354,8 +354,7 @@ resp_begin_html(int code, const char *msg)
" type=\"text/css\" media=\"all\">\n"
"<title>%s</title>\n"
"</head>\n"
- "<body>\n"
- "<!-- Begin page content. //-->\n",
+ "<body>\n",
CSS_DIR, CUSTOMIZE_TITLE);
resp_copy(MAN_DIR "/header.html");
@@ -376,9 +375,7 @@ resp_searchform(const struct req *req, enum focus focus)
{
int i;
- puts("<!-- Begin search form. //-->");
- printf("<div id=\"mancgi\">\n"
- "<form action=\"/%s\" method=\"get\">\n"
+ printf("<form action=\"/%s\" method=\"get\">\n"
"<fieldset>\n"
"<legend>Manual Page Search Parameters</legend>\n",
scriptname);
@@ -446,9 +443,7 @@ resp_searchform(const struct req *req, enum focus focus)
}
puts("</fieldset>\n"
- "</form>\n"
- "</div>");
- puts("<!-- End search form. //-->");
+ "</form>");
}
static int
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index 6182f74c7f4..af77538e630 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_html.c,v 1.78 2017/01/19 01:00:11 schwarze Exp $ */
+/* $OpenBSD: man_html.c,v 1.79 2017/01/19 13:34:59 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -146,24 +146,22 @@ html_man(void *arg, const struct roff_man *man)
{
struct mhtml mh;
struct html *h;
- struct tag *t, *tt;
+ struct tag *t;
memset(&mh, 0, sizeof(mh));
h = (struct html *)arg;
- if ( ! (HTML_FRAGMENT & h->oflags)) {
+ if ((h->oflags & HTML_FRAGMENT) == 0) {
print_gen_decls(h);
- t = print_otag(h, TAG_HTML, "");
- tt = print_otag(h, TAG_HEAD, "");
+ print_otag(h, TAG_HTML, "");
+ t = print_otag(h, TAG_HEAD, "");
print_man_head(&man->meta, man->first, &mh, h);
- print_tagq(h, tt);
+ print_tagq(h, t);
print_otag(h, TAG_BODY, "");
- print_otag(h, TAG_DIV, "c", "mandoc");
- } else
- t = print_otag(h, TAG_DIV, "c", "mandoc");
+ }
print_man_nodelist(&man->meta, man->first, &mh, h);
- print_tagq(h, t);
+ print_tagq(h, NULL);
}
static void
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index b1f8379f80f..a41ce23cbb8 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_html.c,v 1.126 2017/01/19 01:00:11 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.127 2017/01/19 13:34:59 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -297,25 +297,23 @@ void
html_mdoc(void *arg, const struct roff_man *mdoc)
{
struct html *h;
- struct tag *t, *tt;
+ struct tag *t;
h = (struct html *)arg;
- if ( ! (HTML_FRAGMENT & h->oflags)) {
+ if ((h->oflags & HTML_FRAGMENT) == 0) {
print_gen_decls(h);
- t = print_otag(h, TAG_HTML, "");
- tt = print_otag(h, TAG_HEAD, "");
+ print_otag(h, TAG_HTML, "");
+ t = print_otag(h, TAG_HEAD, "");
print_mdoc_head(&mdoc->meta, mdoc->first->child, h);
- print_tagq(h, tt);
+ print_tagq(h, t);
print_otag(h, TAG_BODY, "");
- print_otag(h, TAG_DIV, "c", "mandoc");
- } else
- t = print_otag(h, TAG_DIV, "c", "mandoc");
+ }
mdoc_root_pre(&mdoc->meta, mdoc->first->child, h);
print_mdoc_nodelist(&mdoc->meta, mdoc->first->child, h);
mdoc_root_post(&mdoc->meta, mdoc->first->child, h);
- print_tagq(h, t);
+ print_tagq(h, NULL);
}
static void