In revision 1.95 of cgi.c, a meta viewport element was added to the HTML output.
authoranton <anton@openbsd.org>
Sat, 22 May 2021 05:49:32 +0000 (05:49 +0000)
committeranton <anton@openbsd.org>
Sat, 22 May 2021 05:49:32 +0000 (05:49 +0000)
Let `mandoc -Thtml' behave the same, makes the generated HTML a bit more
pleasant to view on a mobile device.

ok schwarze@

usr.bin/mandoc/html.c

index a922fe5..3b85019 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.143 2021/05/16 18:08:37 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.144 2021/05/22 05:49:32 anton Exp $ */
 /*
  * Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -194,6 +194,8 @@ print_gen_head(struct html *h)
        struct tag      *t;
 
        print_otag(h, TAG_META, "?", "charset", "utf-8");
+       print_otag(h, TAG_META, "??", "name", "viewport",
+           "content", "width=device-width, initial-scale=1.0");
        if (h->style != NULL) {
                print_otag(h, TAG_LINK, "?h??", "rel", "stylesheet",
                    h->style, "type", "text/css", "media", "all");