=================================================================== RCS file: /cvs/mandoc/mdoc_man.c,v retrieving revision 1.109 retrieving revision 1.111 diff -u -p -r1.109 -r1.111 --- mandoc/mdoc_man.c 2017/04/24 23:06:18 1.109 +++ mandoc/mdoc_man.c 2017/05/05 02:06:19 1.111 @@ -1,4 +1,4 @@ -/* $Id: mdoc_man.c,v 1.109 2017/04/24 23:06:18 schwarze Exp $ */ +/* $Id: mdoc_man.c,v 1.111 2017/05/05 02:06:19 schwarze Exp $ */ /* * Copyright (c) 2011-2017 Ingo Schwarze * @@ -20,6 +20,7 @@ #include #include +#include #include #include "mandoc_aux.h" @@ -93,6 +94,7 @@ static int pre_fl(DECL_ARGS); static int pre_fn(DECL_ARGS); static int pre_fo(DECL_ARGS); static int pre_ft(DECL_ARGS); +static int pre_Ft(DECL_ARGS); static int pre_in(DECL_ARGS); static int pre_it(DECL_ARGS); static int pre_lk(DECL_ARGS); @@ -147,14 +149,14 @@ static const struct manact __manacts[MDOC_MAX - MDOC_D { NULL, pre_fd, post_fd, NULL, NULL }, /* Fd */ { NULL, pre_fl, post_fl, NULL, NULL }, /* Fl */ { NULL, pre_fn, post_fn, NULL, NULL }, /* Fn */ - { NULL, pre_ft, post_font, NULL, NULL }, /* Ft */ + { NULL, pre_Ft, post_font, NULL, NULL }, /* Ft */ { NULL, pre_sy, post_font, NULL, NULL }, /* Ic */ { NULL, pre_in, post_in, NULL, NULL }, /* In */ { NULL, pre_li, post_font, NULL, NULL }, /* Li */ { cond_head, pre_enc, NULL, "\\- ", NULL }, /* Nd */ { NULL, pre_nm, post_nm, NULL, NULL }, /* Nm */ { cond_body, pre_enc, post_enc, "[", "]" }, /* Op */ - { NULL, pre_ft, post_font, NULL, NULL }, /* Ot */ + { NULL, pre_Ft, post_font, NULL, NULL }, /* Ot */ { NULL, pre_em, post_font, NULL, NULL }, /* Pa */ { NULL, pre_ex, NULL, NULL, NULL }, /* Rv */ { NULL, NULL, NULL, NULL, NULL }, /* St */ @@ -238,7 +240,6 @@ static const struct manact __manacts[MDOC_MAX - MDOC_D { cond_body, pre_en, post_en, NULL, NULL }, /* En */ { NULL, NULL, NULL, NULL, NULL }, /* Dx */ { NULL, NULL, post_percent, NULL, NULL }, /* %Q */ - { NULL, pre_br, NULL, NULL, NULL }, /* br */ { NULL, pre_sp, post_sp, NULL, NULL }, /* sp */ { NULL, NULL, post_percent, NULL, NULL }, /* %U */ { NULL, NULL, NULL, NULL, NULL }, /* Ta */ @@ -651,7 +652,19 @@ print_node(DECL_ARGS) outflags &= ~(MMAN_spc | MMAN_spc_force); else if (outflags & MMAN_Sm) outflags |= MMAN_spc; + } else if (n->tok < ROFF_MAX) { + switch (n->tok) { + case ROFF_br: + do_sub = pre_br(meta, n); + break; + case ROFF_ft: + do_sub = pre_ft(meta, n); + break; + default: + abort(); + } } else { + assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); /* * Conditionally run the pre-node action handler for a * node. @@ -1305,12 +1318,21 @@ post_fo(DECL_ARGS) } static int -pre_ft(DECL_ARGS) +pre_Ft(DECL_ARGS) { pre_syn(n); font_push('I'); return 1; +} + +static int +pre_ft(DECL_ARGS) +{ + print_line(".ft", 0); + print_word(n->child->string); + outflags |= MMAN_nl; + return 0; } static int