summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_term.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2018-12-31 07:07:43 +0000
committerschwarze <schwarze@openbsd.org>2018-12-31 07:07:43 +0000
commit0438bfdfcae122aef2b2c9bf277771593bd904fc (patch)
treebf15bb27e16b8fe367af135c222fca3cd80d7a1f /usr.bin/mandoc/man_term.c
parentCleanup, minus 15 LOC, no functional change: (diff)
downloadwireguard-openbsd-0438bfdfcae122aef2b2c9bf277771593bd904fc.tar.xz
wireguard-openbsd-0438bfdfcae122aef2b2c9bf277771593bd904fc.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 'usr.bin/mandoc/man_term.c')
-rw-r--r--usr.bin/mandoc/man_term.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 6983e3bbeb8..18533514530 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_term.c,v 1.176 2018/12/30 00:48:47 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.177 2018/12/31 07:07:43 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -115,8 +115,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 */
@@ -245,7 +243,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;
@@ -982,6 +980,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;