summaryrefslogtreecommitdiffstats
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
commit92d4c979c0347b8f0c1db6386d1d1cab338f10e9 (patch)
tree76af07fa76308f0dfa313427139a558fbd3cb05b
parentd47822ce59600455d1974c407664c04d4683b5d0 (diff)
downloadmandoc-92d4c979c0347b8f0c1db6386d1d1cab338f10e9.tar.gz
skip printing the embedded style sheet if an external style is referenced
-rw-r--r--html.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/html.c b/html.c
index 65827058..6033bcba 100644
--- a/html.c
+++ b/html.c
@@ -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