=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/man_html.c,v retrieving revision 1.19 retrieving revision 1.20 diff -c -r1.19 -r1.20 *** src/usr.bin/mandoc/man_html.c 2010/10/15 20:45:03 1.19 --- src/usr.bin/mandoc/man_html.c 2010/11/29 00:12:02 1.20 *************** *** 1,6 **** ! /* $Id: man_html.c,v 1.19 2010/10/15 20:45:03 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above --- 1,7 ---- ! /* $Id: man_html.c,v 1.20 2010/11/29 00:12:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons + * Copyright (c) 2010 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above *************** *** 60,65 **** --- 61,67 ---- 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,120 **** --- 117,123 ---- { man_in_pre, NULL }, /* in */ { NULL, NULL }, /* TS */ { NULL, NULL }, /* TE */ + { man_ft_pre, NULL }, /* ft */ }; *************** *** 726,731 **** --- 729,776 ---- print_ofont(h, HTMLFONT_ITALIC); return(1); + } + + + /* 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); }