summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_html.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/mandoc/man_html.c')
-rw-r--r--usr.bin/mandoc/man_html.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index c2852273b81..22d544b6231 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,6 +1,7 @@
-/* $Id: man_html.c,v 1.19 2010/10/15 20:45:03 schwarze Exp $ */
+/* $Id: man_html.c,v 1.20 2010/11/29 00:12:02 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
+ * Copyright (c) 2010 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
@@ -60,6 +61,7 @@ static int a2width(const struct man_node *,
static int man_alt_pre(MAN_ARGS);
static int man_br_pre(MAN_ARGS);
static int man_ign_pre(MAN_ARGS);
+static int man_ft_pre(MAN_ARGS);
static int man_in_pre(MAN_ARGS);
static int man_literal_pre(MAN_ARGS);
static void man_root_post(MAN_ARGS);
@@ -115,6 +117,7 @@ static const struct htmlman mans[MAN_MAX] = {
{ man_in_pre, NULL }, /* in */
{ NULL, NULL }, /* TS */
{ NULL, NULL }, /* TE */
+ { man_ft_pre, NULL }, /* ft */
};
@@ -731,6 +734,48 @@ man_I_pre(MAN_ARGS)
/* ARGSUSED */
static int
+man_ft_pre(MAN_ARGS)
+{
+ const char *cp;
+
+ if (NULL == n->child) {
+ print_ofont(h, h->metal);
+ return(0);
+ }
+
+ cp = n->child->string;
+ switch (*cp) {
+ case ('4'):
+ /* FALLTHROUGH */
+ case ('3'):
+ /* FALLTHROUGH */
+ case ('B'):
+ print_ofont(h, HTMLFONT_BOLD);
+ break;
+ case ('2'):
+ /* FALLTHROUGH */
+ case ('I'):
+ print_ofont(h, HTMLFONT_ITALIC);
+ break;
+ case ('P'):
+ print_ofont(h, h->metal);
+ break;
+ case ('1'):
+ /* FALLTHROUGH */
+ case ('C'):
+ /* FALLTHROUGH */
+ case ('R'):
+ print_ofont(h, HTMLFONT_NONE);
+ break;
+ default:
+ break;
+ }
+ return(0);
+}
+
+
+/* ARGSUSED */
+static int
man_literal_pre(MAN_ARGS)
{