From 6833508f150b9e1131c3e4446b71833171c103f0 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 31 Dec 2018 07:08:12 +0000 Subject: Move parsing of the .nf and .fi (fill mode) requests from the man(7) parser to the roff(7) parser. As a side effect, .nf and .fi are now also parsed in mdoc(7) input, though the mdoc(7) formatters still ignore most of their effect. --- man_term.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'man_term.c') diff --git a/man_term.c b/man_term.c index 99c2b794..9aa97df2 100644 --- a/man_term.c +++ b/man_term.c @@ -1,4 +1,4 @@ -/* $Id: man_term.c,v 1.223 2018/12/30 00:49:55 schwarze Exp $ */ +/* $Id: man_term.c,v 1.224 2018/12/31 07:08:12 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze @@ -117,8 +117,6 @@ static const struct man_term_act man_term_acts[MAN_MAX - MAN_TH] = { { pre_I, NULL, 0 }, /* I */ { pre_alternate, NULL, 0 }, /* IR */ { pre_alternate, NULL, 0 }, /* RI */ - { pre_literal, NULL, MAN_NOTEXT }, /* nf */ - { pre_literal, NULL, MAN_NOTEXT }, /* fi */ { NULL, NULL, 0 }, /* RE */ { pre_RS, post_RS, 0 }, /* RS */ { pre_DT, NULL, 0 }, /* DT */ @@ -247,7 +245,7 @@ pre_literal(DECL_ARGS) term_newln(p); - if (n->tok == MAN_nf || n->tok == MAN_EX) + if (n->tok == MAN_EX) mt->fl |= MANT_LITERAL; else mt->fl &= ~MANT_LITERAL; @@ -984,6 +982,11 @@ print_man_node(DECL_ARGS) break; } + if (n->tok == ROFF_nf) + n->tok = MAN_EX; + else if (n->tok == ROFF_fi) + n->tok = MAN_EE; + if (n->tok < ROFF_MAX) { roff_term_pre(p, n); return; -- cgit v1.2.3