1 /* $Id: man_term.c,v 1.149 2014/06/20 23:02:31 schwarze Exp $ */
3 * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
4 * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
6 * Permission to use, copy, modify, and distribute this software for any
7 * purpose with or without fee is hereby granted, provided that the above
8 * copyright notice and this permission notice appear in all copies.
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 #include <sys/types.h>
31 #include "mandoc_aux.h"
37 #define MAXMARGINS 64 /* maximum number of indented scopes */
41 #define MANT_LITERAL (1 << 0)
42 size_t lmargin
[MAXMARGINS
]; /* margins (incl. visible page) */
43 int lmargincur
; /* index of current margin */
44 int lmarginsz
; /* actual number of nested margins */
45 size_t offset
; /* default offset to visible page */
46 int pardist
; /* vert. space before par., unit: [v] */
49 #define DECL_ARGS struct termp *p, \
51 const struct man_node *n, \
52 const struct man_meta *meta
55 int (*pre
)(DECL_ARGS
);
56 void (*post
)(DECL_ARGS
);
58 #define MAN_NOTEXT (1 << 0) /* Never has text children. */
61 static int a2width(const struct termp
*, const char *);
62 static size_t a2height(const struct termp
*, const char *);
64 static void print_man_nodelist(DECL_ARGS
);
65 static void print_man_node(DECL_ARGS
);
66 static void print_man_head(struct termp
*, const void *);
67 static void print_man_foot(struct termp
*, const void *);
68 static void print_bvspace(struct termp
*,
69 const struct man_node
*, int);
71 static int pre_B(DECL_ARGS
);
72 static int pre_HP(DECL_ARGS
);
73 static int pre_I(DECL_ARGS
);
74 static int pre_IP(DECL_ARGS
);
75 static int pre_OP(DECL_ARGS
);
76 static int pre_PD(DECL_ARGS
);
77 static int pre_PP(DECL_ARGS
);
78 static int pre_RS(DECL_ARGS
);
79 static int pre_SH(DECL_ARGS
);
80 static int pre_SS(DECL_ARGS
);
81 static int pre_TP(DECL_ARGS
);
82 static int pre_UR(DECL_ARGS
);
83 static int pre_alternate(DECL_ARGS
);
84 static int pre_ft(DECL_ARGS
);
85 static int pre_ign(DECL_ARGS
);
86 static int pre_in(DECL_ARGS
);
87 static int pre_literal(DECL_ARGS
);
88 static int pre_ll(DECL_ARGS
);
89 static int pre_sp(DECL_ARGS
);
91 static void post_IP(DECL_ARGS
);
92 static void post_HP(DECL_ARGS
);
93 static void post_RS(DECL_ARGS
);
94 static void post_SH(DECL_ARGS
);
95 static void post_SS(DECL_ARGS
);
96 static void post_TP(DECL_ARGS
);
97 static void post_UR(DECL_ARGS
);
99 static const struct termact termacts
[MAN_MAX
] = {
100 { pre_sp
, NULL
, MAN_NOTEXT
}, /* br */
101 { NULL
, NULL
, 0 }, /* TH */
102 { pre_SH
, post_SH
, 0 }, /* SH */
103 { pre_SS
, post_SS
, 0 }, /* SS */
104 { pre_TP
, post_TP
, 0 }, /* TP */
105 { pre_PP
, NULL
, 0 }, /* LP */
106 { pre_PP
, NULL
, 0 }, /* PP */
107 { pre_PP
, NULL
, 0 }, /* P */
108 { pre_IP
, post_IP
, 0 }, /* IP */
109 { pre_HP
, post_HP
, 0 }, /* HP */
110 { NULL
, NULL
, 0 }, /* SM */
111 { pre_B
, NULL
, 0 }, /* SB */
112 { pre_alternate
, NULL
, 0 }, /* BI */
113 { pre_alternate
, NULL
, 0 }, /* IB */
114 { pre_alternate
, NULL
, 0 }, /* BR */
115 { pre_alternate
, NULL
, 0 }, /* RB */
116 { NULL
, NULL
, 0 }, /* R */
117 { pre_B
, NULL
, 0 }, /* B */
118 { pre_I
, NULL
, 0 }, /* I */
119 { pre_alternate
, NULL
, 0 }, /* IR */
120 { pre_alternate
, NULL
, 0 }, /* RI */
121 { pre_ign
, NULL
, MAN_NOTEXT
}, /* na */
122 { pre_sp
, NULL
, MAN_NOTEXT
}, /* sp */
123 { pre_literal
, NULL
, 0 }, /* nf */
124 { pre_literal
, NULL
, 0 }, /* fi */
125 { NULL
, NULL
, 0 }, /* RE */
126 { pre_RS
, post_RS
, 0 }, /* RS */
127 { pre_ign
, NULL
, 0 }, /* DT */
128 { pre_ign
, NULL
, 0 }, /* UC */
129 { pre_PD
, NULL
, MAN_NOTEXT
}, /* PD */
130 { pre_ign
, NULL
, 0 }, /* AT */
131 { pre_in
, NULL
, MAN_NOTEXT
}, /* in */
132 { pre_ft
, NULL
, MAN_NOTEXT
}, /* ft */
133 { pre_OP
, NULL
, 0 }, /* OP */
134 { pre_literal
, NULL
, 0 }, /* EX */
135 { pre_literal
, NULL
, 0 }, /* EE */
136 { pre_UR
, post_UR
, 0 }, /* UR */
137 { NULL
, NULL
, 0 }, /* UE */
138 { pre_ll
, NULL
, MAN_NOTEXT
}, /* ll */
143 terminal_man(void *arg
, const struct man
*man
)
146 const struct man_node
*n
;
147 const struct man_meta
*meta
;
150 p
= (struct termp
*)arg
;
152 if (0 == p
->defindent
)
156 p
->maxrmargin
= p
->defrmargin
;
157 p
->tabwidth
= term_len(p
, 5);
159 if (NULL
== p
->symtab
)
160 p
->symtab
= mchars_alloc();
163 meta
= man_meta(man
);
165 term_begin(p
, print_man_head
, print_man_foot
, meta
);
166 p
->flags
|= TERMP_NOSPACE
;
168 memset(&mt
, 0, sizeof(struct mtermp
));
170 mt
.lmargin
[mt
.lmargincur
] = term_len(p
, p
->defindent
);
171 mt
.offset
= term_len(p
, p
->defindent
);
175 print_man_nodelist(p
, &mt
, n
->child
, meta
);
182 a2height(const struct termp
*p
, const char *cp
)
186 if ( ! a2roffsu(cp
, &su
, SCALE_VS
))
187 SCALE_VS_INIT(&su
, atoi(cp
));
189 return(term_vspan(p
, &su
));
193 a2width(const struct termp
*p
, const char *cp
)
197 if ( ! a2roffsu(cp
, &su
, SCALE_BU
))
200 return((int)term_hspan(p
, &su
));
204 * Printing leading vertical space before a block.
205 * This is used for the paragraph macros.
206 * The rules are pretty simple, since there's very little nesting going
207 * on here. Basically, if we're the first within another block (SS/SH),
208 * then don't emit vertical space. If we are (RS), then do. If not the
212 print_bvspace(struct termp
*p
, const struct man_node
*n
, int pardist
)
218 if (n
->body
&& n
->body
->child
)
219 if (MAN_TBL
== n
->body
->child
->type
)
222 if (MAN_ROOT
== n
->parent
->type
|| MAN_RS
!= n
->parent
->tok
)
226 for (i
= 0; i
< pardist
; i
++)
242 term_setwidth(p
, n
->nchild
? n
->child
->string
: NULL
);
250 term_fontrepl(p
, TERMFONT_UNDER
);
255 pre_literal(DECL_ARGS
)
260 if (MAN_nf
== n
->tok
|| MAN_EX
== n
->tok
)
261 mt
->fl
|= MANT_LITERAL
;
263 mt
->fl
&= ~MANT_LITERAL
;
266 * Unlike .IP and .TP, .HP does not have a HEAD.
267 * So in case a second call to term_flushln() is needed,
268 * indentation has to be set up explicitly.
270 if (MAN_HP
== n
->parent
->tok
&& p
->rmargin
< p
->maxrmargin
) {
271 p
->offset
= p
->rmargin
;
272 p
->rmargin
= p
->maxrmargin
;
274 p
->flags
&= ~(TERMP_NOBREAK
| TERMP_BRIND
);
275 p
->flags
|= TERMP_NOSPACE
;
290 assert(MAN_TEXT
== n
->type
);
291 mt
->pardist
= atoi(n
->string
);
296 pre_alternate(DECL_ARGS
)
298 enum termfont font
[2];
299 const struct man_node
*nn
;
304 font
[0] = TERMFONT_NONE
;
305 font
[1] = TERMFONT_BOLD
;
308 font
[0] = TERMFONT_NONE
;
309 font
[1] = TERMFONT_UNDER
;
312 font
[0] = TERMFONT_BOLD
;
313 font
[1] = TERMFONT_NONE
;
316 font
[0] = TERMFONT_BOLD
;
317 font
[1] = TERMFONT_UNDER
;
320 font
[0] = TERMFONT_UNDER
;
321 font
[1] = TERMFONT_NONE
;
324 font
[0] = TERMFONT_UNDER
;
325 font
[1] = TERMFONT_BOLD
;
331 savelit
= MANT_LITERAL
& mt
->fl
;
332 mt
->fl
&= ~MANT_LITERAL
;
334 for (i
= 0, nn
= n
->child
; nn
; nn
= nn
->next
, i
= 1 - i
) {
335 term_fontrepl(p
, font
[i
]);
336 if (savelit
&& NULL
== nn
->next
)
337 mt
->fl
|= MANT_LITERAL
;
338 print_man_node(p
, mt
, nn
, meta
);
340 p
->flags
|= TERMP_NOSPACE
;
350 term_fontrepl(p
, TERMFONT_BOLD
);
359 p
->flags
|= TERMP_NOSPACE
;
361 if (NULL
!= (n
= n
->child
)) {
362 term_fontrepl(p
, TERMFONT_BOLD
);
363 term_word(p
, n
->string
);
365 if (NULL
!= n
&& NULL
!= n
->next
) {
366 term_fontrepl(p
, TERMFONT_UNDER
);
367 term_word(p
, n
->next
->string
);
370 term_fontrepl(p
, TERMFONT_NONE
);
371 p
->flags
|= TERMP_NOSPACE
;
381 if (NULL
== n
->child
) {
386 cp
= n
->child
->string
;
393 term_fontrepl(p
, TERMFONT_BOLD
);
398 term_fontrepl(p
, TERMFONT_UNDER
);
408 term_fontrepl(p
, TERMFONT_NONE
);
425 if (NULL
== n
->child
) {
426 p
->offset
= mt
->offset
;
430 cp
= n
->child
->string
;
440 if ((len
= a2width(p
, ++cp
)) < 0)
446 p
->offset
-= p
->offset
> v
? v
: p
->offset
;
452 /* Don't let this creep beyond the right margin. */
454 if (p
->offset
> p
->rmargin
)
455 p
->offset
= p
->rmargin
;
467 if ((NULL
== n
->prev
&& n
->parent
)) {
468 switch (n
->parent
->tok
) {
491 if (NULL
== n
->child
) {
495 s
= n
->child
->string
;
500 len
= a2height(p
, s
);
509 for (i
= 0; i
< len
; i
++)
520 const struct man_node
*nn
;
524 print_bvspace(p
, n
, mt
->pardist
);
532 if ( ! (MANT_LITERAL
& mt
->fl
)) {
533 p
->flags
|= TERMP_NOBREAK
| TERMP_BRIND
;
537 len
= mt
->lmargin
[mt
->lmargincur
];
540 /* Calculate offset. */
542 if (NULL
!= (nn
= n
->parent
->head
->child
))
543 if ((ival
= a2width(p
, nn
->string
)) >= 0)
546 one
= term_len(p
, 1);
550 p
->offset
= mt
->offset
;
551 p
->rmargin
= mt
->offset
+ len
;
554 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
566 p
->flags
&= ~(TERMP_NOBREAK
| TERMP_BRIND
);
568 p
->offset
= mt
->offset
;
569 p
->rmargin
= p
->maxrmargin
;
582 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
583 print_bvspace(p
, n
, mt
->pardist
);
586 p
->offset
= mt
->offset
;
590 return(MAN_HEAD
!= n
->type
);
596 const struct man_node
*nn
;
602 p
->flags
|= TERMP_NOSPACE
;
605 p
->flags
|= TERMP_NOBREAK
;
609 print_bvspace(p
, n
, mt
->pardist
);
615 len
= mt
->lmargin
[mt
->lmargincur
];
618 /* Calculate the offset from the optional second argument. */
619 if (NULL
!= (nn
= n
->parent
->head
->child
))
620 if (NULL
!= (nn
= nn
->next
))
621 if ((ival
= a2width(p
, nn
->string
)) >= 0)
626 /* Handle zero-width lengths. */
628 len
= term_len(p
, 1);
630 p
->offset
= mt
->offset
;
631 p
->rmargin
= mt
->offset
+ len
;
635 /* Set the saved left-margin. */
636 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
638 savelit
= MANT_LITERAL
& mt
->fl
;
639 mt
->fl
&= ~MANT_LITERAL
;
642 print_man_node(p
, mt
, n
->child
, meta
);
645 mt
->fl
|= MANT_LITERAL
;
649 p
->offset
= mt
->offset
+ len
;
650 p
->rmargin
= p
->maxrmargin
> p
->offset
?
651 p
->maxrmargin
: p
->offset
;
667 p
->flags
&= ~TERMP_NOBREAK
;
669 p
->rmargin
= p
->maxrmargin
;
673 p
->offset
= mt
->offset
;
683 const struct man_node
*nn
;
689 p
->flags
|= TERMP_NOBREAK
;
693 p
->flags
|= TERMP_NOSPACE
;
696 print_bvspace(p
, n
, mt
->pardist
);
702 len
= (size_t)mt
->lmargin
[mt
->lmargincur
];
705 /* Calculate offset. */
707 if (NULL
!= (nn
= n
->parent
->head
->child
))
708 if (nn
->string
&& 0 == (MAN_LINE
& nn
->flags
))
709 if ((ival
= a2width(p
, nn
->string
)) >= 0)
714 /* Handle zero-length properly. */
716 len
= term_len(p
, 1);
718 p
->offset
= mt
->offset
;
719 p
->rmargin
= mt
->offset
+ len
;
721 savelit
= MANT_LITERAL
& mt
->fl
;
722 mt
->fl
&= ~MANT_LITERAL
;
724 /* Don't print same-line elements. */
726 while (NULL
!= nn
&& 0 == (MAN_LINE
& nn
->flags
))
730 print_man_node(p
, mt
, nn
, meta
);
735 mt
->fl
|= MANT_LITERAL
;
737 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
741 p
->offset
= mt
->offset
+ len
;
742 p
->rmargin
= p
->maxrmargin
> p
->offset
?
743 p
->maxrmargin
: p
->offset
;
745 p
->flags
&= ~TERMP_NOBREAK
;
764 p
->offset
= mt
->offset
;
778 mt
->fl
&= ~MANT_LITERAL
;
779 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
780 mt
->offset
= term_len(p
, p
->defindent
);
781 /* If following a prior empty `SS', no vspace. */
782 if (n
->prev
&& MAN_SS
== n
->prev
->tok
)
783 if (NULL
== n
->prev
->body
->child
)
787 for (i
= 0; i
< mt
->pardist
; i
++)
791 term_fontrepl(p
, TERMFONT_BOLD
);
792 p
->offset
= term_len(p
, 3);
795 p
->offset
= mt
->offset
;
827 mt
->fl
&= ~MANT_LITERAL
;
828 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
829 mt
->offset
= term_len(p
, p
->defindent
);
830 /* If following a prior empty `SH', no vspace. */
831 if (n
->prev
&& MAN_SH
== n
->prev
->tok
)
832 if (NULL
== n
->prev
->body
->child
)
834 /* If the first macro, no vspae. */
837 for (i
= 0; i
< mt
->pardist
; i
++)
841 term_fontrepl(p
, TERMFONT_BOLD
);
845 p
->offset
= mt
->offset
;
886 sz
= term_len(p
, p
->defindent
);
888 if (NULL
!= (n
= n
->parent
->head
->child
))
889 if ((ival
= a2width(p
, n
->string
)) >= 0)
893 p
->offset
= mt
->offset
;
894 p
->rmargin
= p
->maxrmargin
> p
->offset
?
895 p
->maxrmargin
: p
->offset
;
897 if (++mt
->lmarginsz
< MAXMARGINS
)
898 mt
->lmargincur
= mt
->lmarginsz
;
900 mt
->lmargin
[mt
->lmargincur
] = mt
->lmargin
[mt
->lmargincur
- 1];
920 sz
= term_len(p
, p
->defindent
);
922 if (NULL
!= (n
= n
->parent
->head
->child
))
923 if ((ival
= a2width(p
, n
->string
)) >= 0)
926 mt
->offset
= mt
->offset
< sz
? 0 : mt
->offset
- sz
;
927 p
->offset
= mt
->offset
;
929 if (--mt
->lmarginsz
< MAXMARGINS
)
930 mt
->lmargincur
= mt
->lmarginsz
;
937 return (MAN_HEAD
!= n
->type
);
944 if (MAN_BLOCK
!= n
->type
)
948 p
->flags
|= TERMP_NOSPACE
;
950 if (NULL
!= n
->child
->child
)
951 print_man_node(p
, mt
, n
->child
->child
, meta
);
953 p
->flags
|= TERMP_NOSPACE
;
958 print_man_node(DECL_ARGS
)
966 * If we have a blank line, output a vertical space.
967 * If we have a space as the first character, break
968 * before printing the line's data.
970 if ('\0' == *n
->string
) {
973 } else if (' ' == *n
->string
&& MAN_LINE
& n
->flags
)
976 term_word(p
, n
->string
);
984 * Tables are preceded by a newline. Then process a
985 * table line, which will cause line termination,
987 if (TBL_SPAN_FIRST
& n
->span
->flags
)
989 term_tbl(p
, n
->span
);
995 if ( ! (MAN_NOTEXT
& termacts
[n
->tok
].flags
))
996 term_fontrepl(p
, TERMFONT_NONE
);
999 if (termacts
[n
->tok
].pre
)
1000 c
= (*termacts
[n
->tok
].pre
)(p
, mt
, n
, meta
);
1003 print_man_nodelist(p
, mt
, n
->child
, meta
);
1005 if (termacts
[n
->tok
].post
)
1006 (*termacts
[n
->tok
].post
)(p
, mt
, n
, meta
);
1007 if ( ! (MAN_NOTEXT
& termacts
[n
->tok
].flags
))
1008 term_fontrepl(p
, TERMFONT_NONE
);
1012 * If we're in a literal context, make sure that words
1013 * together on the same line stay together. This is a
1014 * POST-printing call, so we check the NEXT word. Since
1015 * -man doesn't have nested macros, we don't need to be
1016 * more specific than this.
1018 if (MANT_LITERAL
& mt
->fl
&& ! (TERMP_NOBREAK
& p
->flags
) &&
1019 (NULL
== n
->next
|| MAN_LINE
& n
->next
->flags
)) {
1021 rmax
= p
->maxrmargin
;
1022 p
->rmargin
= p
->maxrmargin
= TERM_MAXMARGIN
;
1023 p
->flags
|= TERMP_NOSPACE
;
1024 if (NULL
!= n
->string
&& '\0' != *n
->string
)
1028 if (rm
< rmax
&& n
->parent
->tok
== MAN_HP
) {
1033 p
->maxrmargin
= rmax
;
1035 if (MAN_EOS
& n
->flags
)
1036 p
->flags
|= TERMP_SENTENCE
;
1041 print_man_nodelist(DECL_ARGS
)
1044 print_man_node(p
, mt
, n
, meta
);
1047 print_man_nodelist(p
, mt
, n
->next
, meta
);
1051 print_man_foot(struct termp
*p
, const void *arg
)
1053 const struct man_meta
*meta
;
1057 meta
= (const struct man_meta
*)arg
;
1058 assert(meta
->title
);
1062 term_fontrepl(p
, TERMFONT_NONE
);
1068 * Temporary, undocumented option to imitate mdoc(7) output.
1069 * In the bottom right corner, use the source instead of
1073 if ( ! p
->mdocstyle
) {
1074 if (meta
->hasbody
) {
1078 mandoc_asprintf(&title
, "%s(%s)",
1079 meta
->title
, meta
->msec
);
1080 } else if (meta
->source
) {
1081 title
= mandoc_strdup(meta
->source
);
1083 title
= mandoc_strdup("");
1085 datelen
= term_strlen(p
, meta
->date
);
1087 /* Bottom left corner: manual source. */
1089 p
->flags
|= TERMP_NOSPACE
| TERMP_NOBREAK
;
1092 p
->rmargin
= (p
->maxrmargin
- datelen
+ term_len(p
, 1)) / 2;
1095 term_word(p
, meta
->source
);
1098 /* At the bottom in the middle: manual date. */
1100 p
->flags
|= TERMP_NOSPACE
;
1101 p
->offset
= p
->rmargin
;
1102 p
->rmargin
= p
->maxrmargin
- term_strlen(p
, title
);
1103 if (p
->offset
+ datelen
>= p
->rmargin
)
1104 p
->rmargin
= p
->offset
+ datelen
;
1106 term_word(p
, meta
->date
);
1109 /* Bottom right corner: manual title and section. */
1111 p
->flags
&= ~TERMP_NOBREAK
;
1112 p
->flags
|= TERMP_NOSPACE
;
1114 p
->offset
= p
->rmargin
;
1115 p
->rmargin
= p
->maxrmargin
;
1117 term_word(p
, title
);
1123 print_man_head(struct termp
*p
, const void *arg
)
1125 const struct man_meta
*meta
;
1128 size_t vollen
, titlen
;
1130 meta
= (const struct man_meta
*)arg
;
1131 assert(meta
->title
);
1134 volume
= NULL
== meta
->vol
? "" : meta
->vol
;
1135 vollen
= term_strlen(p
, volume
);
1137 /* Top left corner: manual title and section. */
1139 mandoc_asprintf(&title
, "%s(%s)", meta
->title
, meta
->msec
);
1140 titlen
= term_strlen(p
, title
);
1142 p
->flags
|= TERMP_NOBREAK
| TERMP_NOSPACE
;
1145 p
->rmargin
= 2 * (titlen
+1) + vollen
< p
->maxrmargin
?
1146 (p
->maxrmargin
- vollen
+ term_len(p
, 1)) / 2 :
1147 p
->maxrmargin
- vollen
;
1149 term_word(p
, title
);
1152 /* At the top in the middle: manual volume. */
1154 p
->flags
|= TERMP_NOSPACE
;
1155 p
->offset
= p
->rmargin
;
1156 p
->rmargin
= p
->offset
+ vollen
+ titlen
< p
->maxrmargin
?
1157 p
->maxrmargin
- titlen
: p
->maxrmargin
;
1159 term_word(p
, volume
);
1162 /* Top right corner: title and section, again. */
1164 p
->flags
&= ~TERMP_NOBREAK
;
1166 if (p
->rmargin
+ titlen
<= p
->maxrmargin
) {
1167 p
->flags
|= TERMP_NOSPACE
;
1168 p
->offset
= p
->rmargin
;
1169 p
->rmargin
= p
->maxrmargin
;
1170 term_word(p
, title
);
1174 p
->flags
&= ~TERMP_NOSPACE
;
1176 p
->rmargin
= p
->maxrmargin
;
1179 * Groff prints three blank lines before the content.
1180 * Do the same, except in the temporary, undocumented
1181 * mode imitating mdoc(7) output.
1185 if ( ! p
->mdocstyle
) {