From 3f648213cd789e9c307f834875f09da5e1d86ab1 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 17 Sep 2009 07:41:28 +0000 Subject: ascii_xxx -> chars_xxx (intended to hold more than just ascii encoding). More html work. --- html.c | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'html.c') diff --git a/html.c b/html.c index d9fa90d5..c8a4623c 100644 --- a/html.c +++ b/html.c @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.30 2009/09/16 22:17:27 kristaps Exp $ */ +/* $Id: html.c,v 1.31 2009/09/17 07:41:28 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -138,9 +138,11 @@ static void print_encode(const char *); static void print_text(struct html *, const char *); static int mdoc_root_pre(MDOC_ARGS); +static int mdoc_ar_pre(MDOC_ARGS); static int mdoc_fl_pre(MDOC_ARGS); static int mdoc_nd_pre(MDOC_ARGS); static int mdoc_nm_pre(MDOC_ARGS); +static int mdoc_ns_pre(MDOC_ARGS); static int mdoc_op_pre(MDOC_ARGS); static void mdoc_op_post(MDOC_ARGS); static int mdoc_pp_pre(MDOC_ARGS); @@ -165,7 +167,7 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = { {NULL, NULL}, /* It */ {NULL, NULL}, /* Ad */ {NULL, NULL}, /* An */ - {NULL, NULL}, /* Ar */ + {mdoc_ar_pre, NULL}, /* Ar */ {NULL, NULL}, /* Cd */ {NULL, NULL}, /* Cm */ {NULL, NULL}, /* Dv */ @@ -222,7 +224,7 @@ static const struct htmlmdoc mdocs[MDOC_MAX] = { {NULL, NULL}, /* Fx */ {NULL, NULL}, /* Ms */ {NULL, NULL}, /* No */ - {NULL, NULL}, /* Ns */ + {mdoc_ns_pre, NULL}, /* Ns */ {NULL, NULL}, /* Nx */ {NULL, NULL}, /* Ox */ {NULL, NULL}, /* Pc */ @@ -697,7 +699,7 @@ mdoc_nd_pre(MDOC_ARGS) { if (MDOC_BODY == n->type) - print_text(h, "--"); + print_text(h, "\\(en"); return(1); } @@ -785,3 +787,27 @@ mdoc_xr_pre(MDOC_ARGS) return(0); } + + +/* ARGSUSED */ +static int +mdoc_ns_pre(MDOC_ARGS) +{ + + h->flags |= HTML_NOSPACE; + return(1); +} + + +/* ARGSUSED */ +static int +mdoc_ar_pre(MDOC_ARGS) +{ + struct htmlpair tag; + + tag.key = ATTR_CLASS; + tag.val = "arg"; + + print_otag(h, TAG_SPAN, 1, &tag); + return(1); +} -- cgit v1.2.3-56-ge451