]> git.cameronkatri.com Git - mandoc.git/blobdiff - html.c
we already parse the GNU tbl(7) "nospaces" option,
[mandoc.git] / html.c
diff --git a/html.c b/html.c
index 0096c2db7f752ebae2dfe3dfa8be0f79dc6fa356..7cd694f1b1fffd466a8c8bc259cae4a712714f8e 100644 (file)
--- a/html.c
+++ b/html.c
@@ -1,7 +1,7 @@
-/* $Id: html.c,v 1.271 2020/10/16 17:22:43 schwarze Exp $ */
+/* $Id: html.c,v 1.274 2021/08/10 12:55:03 schwarze Exp $ */
 /*
- * Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
  * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2011-2015, 2017-2021 Ingo Schwarze <schwarze@openbsd.org>
  *
  * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above
@@ -140,6 +140,7 @@ html_alloc(const struct manoutput *outopts)
        h = mandoc_calloc(1, sizeof(struct html));
 
        h->tag = NULL;
+       h->metac = h->metal = ESCAPE_FONTROMAN;
        h->style = outopts->style;
        if ((h->base_man1 = outopts->man) == NULL)
                h->base_man2 = NULL;
@@ -195,6 +196,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");
@@ -237,8 +240,10 @@ html_setfont(struct html *h, enum mandoc_esc font)
        case ESCAPE_FONTITALIC:
        case ESCAPE_FONTBOLD:
        case ESCAPE_FONTBI:
-       case ESCAPE_FONTCW:
        case ESCAPE_FONTROMAN:
+       case ESCAPE_FONTCR:
+       case ESCAPE_FONTCB:
+       case ESCAPE_FONTCI:
                break;
        case ESCAPE_FONT:
                font = ESCAPE_FONTROMAN;
@@ -269,9 +274,17 @@ print_metaf(struct html *h)
                h->metaf = print_otag(h, TAG_B, "");
                print_otag(h, TAG_I, "");
                break;
-       case ESCAPE_FONTCW:
+       case ESCAPE_FONTCR:
                h->metaf = print_otag(h, TAG_SPAN, "c", "Li");
                break;
+       case ESCAPE_FONTCB:
+               h->metaf = print_otag(h, TAG_SPAN, "c", "Li");
+               print_otag(h, TAG_B, "");
+               break;
+       case ESCAPE_FONTCI:
+               h->metaf = print_otag(h, TAG_SPAN, "c", "Li");
+               print_otag(h, TAG_I, "");
+               break;
        default:
                break;
        }
@@ -500,8 +513,10 @@ print_encode(struct html *h, const char *p, const char *pend, int norecurse)
                case ESCAPE_FONTBOLD:
                case ESCAPE_FONTITALIC:
                case ESCAPE_FONTBI:
-               case ESCAPE_FONTCW:
                case ESCAPE_FONTROMAN:
+               case ESCAPE_FONTCR:
+               case ESCAPE_FONTCB:
+               case ESCAPE_FONTCI:
                        if (0 == norecurse) {
                                h->flags |= HTML_NOSPACE;
                                if (html_setfont(h, esc))