aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2018-12-31 07:08:12 +0000
committerIngo Schwarze <schwarze@openbsd.org>2018-12-31 07:08:12 +0000
commit6833508f150b9e1131c3e4446b71833171c103f0 (patch)
tree55cb47fe86eb32db5363cbc4ba3c48a3681bb870 /man_term.c
parent04c844c9b370f59b5c07157eec6ba5a879b30218 (diff)
downloadmandoc-6833508f150b9e1131c3e4446b71833171c103f0.tar.gz
mandoc-6833508f150b9e1131c3e4446b71833171c103f0.tar.zst
mandoc-6833508f150b9e1131c3e4446b71833171c103f0.zip
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.
Diffstat (limited to 'man_term.c')
-rw-r--r--man_term.c11
1 files changed, 7 insertions, 4 deletions
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 <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -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;