From 01d369a8105af24b0d6df42f974ff6b8d59dd258 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Tue, 10 Jan 2017 23:36:34 +0000 Subject: Use new NODE_NOSRC and NODE_NOPRT flags for .Bx and .At. More rigorous AST and 40 lines less code. --- mdoc_html.c | 32 ++------------------------------ 1 file changed, 2 insertions(+), 30 deletions(-) (limited to 'mdoc_html.c') diff --git a/mdoc_html.c b/mdoc_html.c index 402a847b..20b344fc 100644 --- a/mdoc_html.c +++ b/mdoc_html.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_html.c,v 1.245 2017/01/10 21:59:47 schwarze Exp $ */ +/* $Id: mdoc_html.c,v 1.246 2017/01/10 23:36:34 schwarze Exp $ */ /* * Copyright (c) 2008-2011, 2014 Kristaps Dzonsons * Copyright (c) 2014, 2015, 2016, 2017 Ingo Schwarze @@ -71,7 +71,6 @@ static void mdoc_bk_post(MDOC_ARGS); static int mdoc_bk_pre(MDOC_ARGS); static int mdoc_bl_pre(MDOC_ARGS); static int mdoc_bt_pre(MDOC_ARGS); -static int mdoc_bx_pre(MDOC_ARGS); static int mdoc_cd_pre(MDOC_ARGS); static int mdoc_d1_pre(MDOC_ARGS); static int mdoc_dv_pre(MDOC_ARGS); @@ -183,7 +182,7 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = { {mdoc_quote_pre, mdoc_quote_post}, /* Bo */ {mdoc_quote_pre, mdoc_quote_post}, /* Bq */ {mdoc_xx_pre, NULL}, /* Bsx */ - {mdoc_bx_pre, NULL}, /* Bx */ + {mdoc_xx_pre, NULL}, /* Bx */ {mdoc_skip_pre, NULL}, /* Db */ {NULL, NULL}, /* Dc */ {mdoc_quote_pre, mdoc_quote_post}, /* Do */ @@ -739,33 +738,6 @@ mdoc_xx_pre(MDOC_ARGS) return 1; } -static int -mdoc_bx_pre(MDOC_ARGS) -{ - struct htmlpair tag; - - PAIR_CLASS_INIT(&tag, "unix"); - print_otag(h, TAG_SPAN, 1, &tag); - - if (NULL != (n = n->child)) { - print_text(h, n->string); - h->flags |= HTML_NOSPACE; - print_text(h, "BSD"); - } else { - print_text(h, "BSD"); - return 0; - } - - if (NULL != (n = n->next)) { - h->flags |= HTML_NOSPACE; - print_text(h, "-"); - h->flags |= HTML_NOSPACE; - print_text(h, n->string); - } - - return 0; -} - static int mdoc_it_pre(MDOC_ARGS) { -- cgit v1.2.3-56-ge451