aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_html.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-01-10 21:59:47 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-01-10 21:59:47 +0000
commitb8b4c05111a45cab71949b527a6060013e5fac66 (patch)
tree8f6d68f2e548b7c715c5dbae5d85ca8e8a3ca0c4 /mdoc_html.c
parente5e6b19e8e4776c4e2703f500ffc8eb70f2285d4 (diff)
downloadmandoc-b8b4c05111a45cab71949b527a6060013e5fac66.tar.gz
mandoc-b8b4c05111a45cab71949b527a6060013e5fac66.tar.zst
mandoc-b8b4c05111a45cab71949b527a6060013e5fac66.zip
For the .Ux/.Ox family of macros, do text production at the validation
stage rather than in each and every individual formatter, using the new NODE_NOSRC flag. More rigorous and also ten lines less code.
Diffstat (limited to 'mdoc_html.c')
-rw-r--r--mdoc_html.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/mdoc_html.c b/mdoc_html.c
index e4c018b4..402a847b 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_html.c,v 1.244 2017/01/10 13:47:00 schwarze Exp $ */
+/* $Id: mdoc_html.c,v 1.245 2017/01/10 21:59:47 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -732,44 +732,11 @@ mdoc_ar_pre(MDOC_ARGS)
static int
mdoc_xx_pre(MDOC_ARGS)
{
- const char *pp;
struct htmlpair tag;
- int flags;
-
- switch (n->tok) {
- case MDOC_Bsx:
- pp = "BSD/OS";
- break;
- case MDOC_Dx:
- pp = "DragonFly";
- break;
- case MDOC_Fx:
- pp = "FreeBSD";
- break;
- case MDOC_Nx:
- pp = "NetBSD";
- break;
- case MDOC_Ox:
- pp = "OpenBSD";
- break;
- case MDOC_Ux:
- pp = "UNIX";
- break;
- default:
- return 1;
- }
PAIR_CLASS_INIT(&tag, "unix");
print_otag(h, TAG_SPAN, 1, &tag);
-
- print_text(h, pp);
- if (n->child) {
- flags = h->flags;
- h->flags |= HTML_KEEP;
- print_text(h, n->child->string);
- h->flags = flags;
- }
- return 0;
+ return 1;
}
static int