=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mdoc_term.c,v retrieving revision 1.218 retrieving revision 1.219 diff -c -r1.218 -r1.219 *** src/usr.bin/mandoc/mdoc_term.c 2015/04/18 17:50:02 1.218 --- src/usr.bin/mandoc/mdoc_term.c 2015/07/17 22:35:36 1.219 *************** *** 1,4 **** ! /* $OpenBSD: mdoc_term.c,v 1.218 2015/04/18 17:50:02 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze --- 1,4 ---- ! /* $OpenBSD: mdoc_term.c,v 1.219 2015/07/17 22:35:36 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze *************** *** 32,37 **** --- 32,38 ---- #include "mdoc.h" #include "out.h" #include "term.h" + #include "tag.h" #include "main.h" struct termpair { *************** *** 115,120 **** --- 116,122 ---- static int termp_sm_pre(DECL_ARGS); static int termp_sp_pre(DECL_ARGS); static int termp_ss_pre(DECL_ARGS); + static int termp_tag_pre(DECL_ARGS); static int termp_under_pre(DECL_ARGS); static int termp_ud_pre(DECL_ARGS); static int termp_vt_pre(DECL_ARGS); *************** *** 143,149 **** { termp_bold_pre, NULL }, /* Cm */ { NULL, NULL }, /* Dv */ { NULL, NULL }, /* Er */ ! { NULL, NULL }, /* Ev */ { termp_ex_pre, NULL }, /* Ex */ { termp_fa_pre, NULL }, /* Fa */ { termp_fd_pre, termp_fd_post }, /* Fd */ --- 145,151 ---- { termp_bold_pre, NULL }, /* Cm */ { NULL, NULL }, /* Dv */ { NULL, NULL }, /* Er */ ! { termp_tag_pre, NULL }, /* Ev */ { termp_ex_pre, NULL }, /* Ex */ { termp_fa_pre, NULL }, /* Fa */ { termp_fd_pre, termp_fd_post }, /* Fd */ *************** *** 1047,1052 **** --- 1049,1055 ---- termp_fl_pre(DECL_ARGS) { + termp_tag_pre(p, pair, meta, n); term_fontpush(p, TERMFONT_BOLD); term_word(p, "\\-"); *************** *** 1328,1333 **** --- 1331,1337 ---- termp_bold_pre(DECL_ARGS) { + termp_tag_pre(p, pair, meta, n); term_fontpush(p, TERMFONT_BOLD); return(1); } *************** *** 2248,2252 **** --- 2252,2272 ---- { term_fontpush(p, TERMFONT_UNDER); + return(1); + } + + static int + termp_tag_pre(DECL_ARGS) + { + + if (n->child != NULL && + n->child->type == ROFFT_TEXT && + n->prev == NULL && + (n->parent->tok == MDOC_It || + (n->parent->tok == MDOC_Xo && + n->parent->parent->prev == NULL && + n->parent->parent->parent->tok == MDOC_It)) && + ! tag_get(n->child->string, 0)) + tag_put(n->child->string, 0, p->line); return(1); }