summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2018-05-01 23:36:39 +0000
committerschwarze <schwarze@openbsd.org>2018-05-01 23:36:39 +0000
commit4579ceb66286ae5f05f53c4dc6a748474c41ffef (patch)
treed3db76dd8e41143273844f7abbaaf0ee9cc6a6e1
parentIn x509.h rev. 1.46 2018/05/01 19:01:28, tb@ added const qualifiers (diff)
downloadwireguard-openbsd-4579ceb66286ae5f05f53c4dc6a748474c41ffef.tar.xz
wireguard-openbsd-4579ceb66286ae5f05f53c4dc6a748474c41ffef.zip
skip printing the embedded style sheet if an external style is referenced
-rw-r--r--usr.bin/mandoc/html.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index feb9f8a8f4d..8dd4040ded3 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.91 2018/04/13 16:27:14 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.92 2018/05/01 23:36:39 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -166,9 +166,14 @@ print_gen_head(struct html *h)
struct tag *t;
print_otag(h, TAG_META, "?", "charset", "utf-8");
+ if (h->style != NULL) {
+ print_otag(h, TAG_LINK, "?h??", "rel", "stylesheet",
+ h->style, "type", "text/css", "media", "all");
+ return;
+ }
/*
- * Print a default style-sheet.
+ * Print a minimal embedded style sheet.
*/
t = print_otag(h, TAG_STYLE, "");
@@ -180,10 +185,6 @@ print_gen_head(struct html *h)
print_endline(h);
print_text(h, "div.Pp { margin: 1ex 0ex; }");
print_tagq(h, t);
-
- if (h->style)
- print_otag(h, TAG_LINK, "?h??", "rel", "stylesheet",
- h->style, "type", "text/css", "media", "all");
}
static void