aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-05-01 23:36:55 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-05-01 23:36:55 +0000
commit2f1a90dcb17e516d3dc62de5772fdce8a48646dd (patch)
treec6ae15365ddb4787d4ecfb54314270bfdd008a7f
parentd1759ec419f7c15329f9a4074940b0623819e384 (diff)
downloadmandoc-2f1a90dcb17e516d3dc62de5772fdce8a48646dd.tar.gz
mandoc-2f1a90dcb17e516d3dc62de5772fdce8a48646dd.tar.zst
mandoc-2f1a90dcb17e516d3dc62de5772fdce8a48646dd.zip
skip printing the embedded style sheet if an external style is referenced
-rw-r--r--html.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/html.c b/html.c
index 68ec1f14..ad224671 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.221 2018/04/13 16:28:07 schwarze Exp $ */
+/* $Id: html.c,v 1.222 2018/05/01 23:36:55 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -168,9 +168,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, "");
@@ -182,10 +187,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