]>
git.cameronkatri.com Git - mandoc.git/blob - man_term.c
1 /* $Id: man_term.c,v 1.144 2014/03/30 21:28:01 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>
36 #define MAXMARGINS 64 /* maximum number of indented scopes */
40 #define MANT_LITERAL (1 << 0)
41 size_t lmargin
[MAXMARGINS
]; /* margins (incl. visible page) */
42 int lmargincur
; /* index of current margin */
43 int lmarginsz
; /* actual number of nested margins */
44 size_t offset
; /* default offset to visible page */
45 int pardist
; /* vert. space before par., unit: [v] */
48 #define DECL_ARGS struct termp *p, \
50 const struct man_node *n, \
51 const struct man_meta *meta
54 int (*pre
)(DECL_ARGS
);
55 void (*post
)(DECL_ARGS
);
57 #define MAN_NOTEXT (1 << 0) /* Never has text children. */
60 static int a2width(const struct termp
*, const char *);
61 static size_t a2height(const struct termp
*, const char *);
63 static void print_man_nodelist(DECL_ARGS
);
64 static void print_man_node(DECL_ARGS
);
65 static void print_man_head(struct termp
*, const void *);
66 static void print_man_foot(struct termp
*, const void *);
67 static void print_bvspace(struct termp
*,
68 const struct man_node
*, int);
70 static int pre_B(DECL_ARGS
);
71 static int pre_HP(DECL_ARGS
);
72 static int pre_I(DECL_ARGS
);
73 static int pre_IP(DECL_ARGS
);
74 static int pre_OP(DECL_ARGS
);
75 static int pre_PD(DECL_ARGS
);
76 static int pre_PP(DECL_ARGS
);
77 static int pre_RS(DECL_ARGS
);
78 static int pre_SH(DECL_ARGS
);
79 static int pre_SS(DECL_ARGS
);
80 static int pre_TP(DECL_ARGS
);
81 static int pre_UR(DECL_ARGS
);
82 static int pre_alternate(DECL_ARGS
);
83 static int pre_ft(DECL_ARGS
);
84 static int pre_ign(DECL_ARGS
);
85 static int pre_in(DECL_ARGS
);
86 static int pre_literal(DECL_ARGS
);
87 static int pre_ll(DECL_ARGS
);
88 static int pre_sp(DECL_ARGS
);
90 static void post_IP(DECL_ARGS
);
91 static void post_HP(DECL_ARGS
);
92 static void post_RS(DECL_ARGS
);
93 static void post_SH(DECL_ARGS
);
94 static void post_SS(DECL_ARGS
);
95 static void post_TP(DECL_ARGS
);
96 static void post_UR(DECL_ARGS
);
98 static const struct termact termacts
[MAN_MAX
] = {
99 { pre_sp
, NULL
, MAN_NOTEXT
}, /* br */
100 { NULL
, NULL
, 0 }, /* TH */
101 { pre_SH
, post_SH
, 0 }, /* SH */
102 { pre_SS
, post_SS
, 0 }, /* SS */
103 { pre_TP
, post_TP
, 0 }, /* TP */
104 { pre_PP
, NULL
, 0 }, /* LP */
105 { pre_PP
, NULL
, 0 }, /* PP */
106 { pre_PP
, NULL
, 0 }, /* P */
107 { pre_IP
, post_IP
, 0 }, /* IP */
108 { pre_HP
, post_HP
, 0 }, /* HP */
109 { NULL
, NULL
, 0 }, /* SM */
110 { pre_B
, NULL
, 0 }, /* SB */
111 { pre_alternate
, NULL
, 0 }, /* BI */
112 { pre_alternate
, NULL
, 0 }, /* IB */
113 { pre_alternate
, NULL
, 0 }, /* BR */
114 { pre_alternate
, NULL
, 0 }, /* RB */
115 { NULL
, NULL
, 0 }, /* R */
116 { pre_B
, NULL
, 0 }, /* B */
117 { pre_I
, NULL
, 0 }, /* I */
118 { pre_alternate
, NULL
, 0 }, /* IR */
119 { pre_alternate
, NULL
, 0 }, /* RI */
120 { pre_ign
, NULL
, MAN_NOTEXT
}, /* na */
121 { pre_sp
, NULL
, MAN_NOTEXT
}, /* sp */
122 { pre_literal
, NULL
, 0 }, /* nf */
123 { pre_literal
, NULL
, 0 }, /* fi */
124 { NULL
, NULL
, 0 }, /* RE */
125 { pre_RS
, post_RS
, 0 }, /* RS */
126 { pre_ign
, NULL
, 0 }, /* DT */
127 { pre_ign
, NULL
, 0 }, /* UC */
128 { pre_PD
, NULL
, MAN_NOTEXT
}, /* PD */
129 { pre_ign
, NULL
, 0 }, /* AT */
130 { pre_in
, NULL
, MAN_NOTEXT
}, /* in */
131 { pre_ft
, NULL
, MAN_NOTEXT
}, /* ft */
132 { pre_OP
, NULL
, 0 }, /* OP */
133 { pre_literal
, NULL
, 0 }, /* EX */
134 { pre_literal
, NULL
, 0 }, /* EE */
135 { pre_UR
, post_UR
, 0 }, /* UR */
136 { NULL
, NULL
, 0 }, /* UE */
137 { 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
));
194 a2width(const struct termp
*p
, const char *cp
)
198 if ( ! a2roffsu(cp
, &su
, SCALE_BU
))
201 return((int)term_hspan(p
, &su
));
205 * Printing leading vertical space before a block.
206 * This is used for the paragraph macros.
207 * The rules are pretty simple, since there's very little nesting going
208 * on here. Basically, if we're the first within another block (SS/SH),
209 * then don't emit vertical space. If we are (RS), then do. If not the
213 print_bvspace(struct termp
*p
, const struct man_node
*n
, int pardist
)
219 if (n
->body
&& n
->body
->child
)
220 if (MAN_TBL
== n
->body
->child
->type
)
223 if (MAN_ROOT
== n
->parent
->type
|| MAN_RS
!= n
->parent
->tok
)
227 for (i
= 0; i
< pardist
; i
++)
245 term_setwidth(p
, n
->nchild
? n
->child
->string
: NULL
);
255 term_fontrepl(p
, TERMFONT_UNDER
);
262 pre_literal(DECL_ARGS
)
267 if (MAN_nf
== n
->tok
|| MAN_EX
== n
->tok
)
268 mt
->fl
|= MANT_LITERAL
;
270 mt
->fl
&= ~MANT_LITERAL
;
273 * Unlike .IP and .TP, .HP does not have a HEAD.
274 * So in case a second call to term_flushln() is needed,
275 * indentation has to be set up explicitly.
277 if (MAN_HP
== n
->parent
->tok
&& p
->rmargin
< p
->maxrmargin
) {
278 p
->offset
= p
->rmargin
;
279 p
->rmargin
= p
->maxrmargin
;
281 p
->flags
&= ~TERMP_NOBREAK
;
282 p
->flags
|= TERMP_NOSPACE
;
298 assert(MAN_TEXT
== n
->type
);
299 mt
->pardist
= atoi(n
->string
);
305 pre_alternate(DECL_ARGS
)
307 enum termfont font
[2];
308 const struct man_node
*nn
;
313 font
[0] = TERMFONT_NONE
;
314 font
[1] = TERMFONT_BOLD
;
317 font
[0] = TERMFONT_NONE
;
318 font
[1] = TERMFONT_UNDER
;
321 font
[0] = TERMFONT_BOLD
;
322 font
[1] = TERMFONT_NONE
;
325 font
[0] = TERMFONT_BOLD
;
326 font
[1] = TERMFONT_UNDER
;
329 font
[0] = TERMFONT_UNDER
;
330 font
[1] = TERMFONT_NONE
;
333 font
[0] = TERMFONT_UNDER
;
334 font
[1] = TERMFONT_BOLD
;
340 savelit
= MANT_LITERAL
& mt
->fl
;
341 mt
->fl
&= ~MANT_LITERAL
;
343 for (i
= 0, nn
= n
->child
; nn
; nn
= nn
->next
, i
= 1 - i
) {
344 term_fontrepl(p
, font
[i
]);
345 if (savelit
&& NULL
== nn
->next
)
346 mt
->fl
|= MANT_LITERAL
;
347 print_man_node(p
, mt
, nn
, meta
);
349 p
->flags
|= TERMP_NOSPACE
;
360 term_fontrepl(p
, TERMFONT_BOLD
);
370 p
->flags
|= TERMP_NOSPACE
;
372 if (NULL
!= (n
= n
->child
)) {
373 term_fontrepl(p
, TERMFONT_BOLD
);
374 term_word(p
, n
->string
);
376 if (NULL
!= n
&& NULL
!= n
->next
) {
377 term_fontrepl(p
, TERMFONT_UNDER
);
378 term_word(p
, n
->next
->string
);
381 term_fontrepl(p
, TERMFONT_NONE
);
382 p
->flags
|= TERMP_NOSPACE
;
393 if (NULL
== n
->child
) {
398 cp
= n
->child
->string
;
405 term_fontrepl(p
, TERMFONT_BOLD
);
410 term_fontrepl(p
, TERMFONT_UNDER
);
420 term_fontrepl(p
, TERMFONT_NONE
);
438 if (NULL
== n
->child
) {
439 p
->offset
= mt
->offset
;
443 cp
= n
->child
->string
;
453 if ((len
= a2width(p
, ++cp
)) < 0)
459 p
->offset
-= p
->offset
> v
? v
: p
->offset
;
465 /* Don't let this creep beyond the right margin. */
467 if (p
->offset
> p
->rmargin
)
468 p
->offset
= p
->rmargin
;
482 if ((NULL
== n
->prev
&& n
->parent
)) {
483 switch (n
->parent
->tok
) {
506 if (NULL
== n
->child
) {
510 s
= n
->child
->string
;
515 len
= a2height(p
, s
);
524 for (i
= 0; i
< len
; i
++)
537 const struct man_node
*nn
;
541 print_bvspace(p
, n
, mt
->pardist
);
549 if ( ! (MANT_LITERAL
& mt
->fl
)) {
550 p
->flags
|= TERMP_NOBREAK
;
554 len
= mt
->lmargin
[mt
->lmargincur
];
557 /* Calculate offset. */
559 if (NULL
!= (nn
= n
->parent
->head
->child
))
560 if ((ival
= a2width(p
, nn
->string
)) >= 0)
563 one
= term_len(p
, 1);
567 p
->offset
= mt
->offset
;
568 p
->rmargin
= mt
->offset
+ len
;
571 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
585 p
->flags
&= ~TERMP_NOBREAK
;
587 p
->offset
= mt
->offset
;
588 p
->rmargin
= p
->maxrmargin
;
603 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
604 print_bvspace(p
, n
, mt
->pardist
);
607 p
->offset
= mt
->offset
;
611 return(MAN_HEAD
!= n
->type
);
619 const struct man_node
*nn
;
625 p
->flags
|= TERMP_NOSPACE
;
628 p
->flags
|= TERMP_NOBREAK
;
632 print_bvspace(p
, n
, mt
->pardist
);
638 len
= mt
->lmargin
[mt
->lmargincur
];
641 /* Calculate the offset from the optional second argument. */
642 if (NULL
!= (nn
= n
->parent
->head
->child
))
643 if (NULL
!= (nn
= nn
->next
))
644 if ((ival
= a2width(p
, nn
->string
)) >= 0)
649 /* Handle zero-width lengths. */
651 len
= term_len(p
, 1);
653 p
->offset
= mt
->offset
;
654 p
->rmargin
= mt
->offset
+ len
;
658 /* Set the saved left-margin. */
659 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
661 savelit
= MANT_LITERAL
& mt
->fl
;
662 mt
->fl
&= ~MANT_LITERAL
;
665 print_man_node(p
, mt
, n
->child
, meta
);
668 mt
->fl
|= MANT_LITERAL
;
672 p
->offset
= mt
->offset
+ len
;
673 p
->rmargin
= p
->maxrmargin
> p
->offset
?
674 p
->maxrmargin
: p
->offset
;
692 p
->flags
&= ~TERMP_NOBREAK
;
694 p
->rmargin
= p
->maxrmargin
;
698 p
->offset
= mt
->offset
;
710 const struct man_node
*nn
;
716 p
->flags
|= TERMP_NOBREAK
;
720 p
->flags
|= TERMP_NOSPACE
;
723 print_bvspace(p
, n
, mt
->pardist
);
729 len
= (size_t)mt
->lmargin
[mt
->lmargincur
];
732 /* Calculate offset. */
734 if (NULL
!= (nn
= n
->parent
->head
->child
))
735 if (nn
->string
&& 0 == (MAN_LINE
& nn
->flags
))
736 if ((ival
= a2width(p
, nn
->string
)) >= 0)
741 /* Handle zero-length properly. */
743 len
= term_len(p
, 1);
745 p
->offset
= mt
->offset
;
746 p
->rmargin
= mt
->offset
+ len
;
748 savelit
= MANT_LITERAL
& mt
->fl
;
749 mt
->fl
&= ~MANT_LITERAL
;
751 /* Don't print same-line elements. */
753 while (NULL
!= nn
&& 0 == (MAN_LINE
& nn
->flags
))
757 print_man_node(p
, mt
, nn
, meta
);
762 mt
->fl
|= MANT_LITERAL
;
764 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
768 p
->offset
= mt
->offset
+ len
;
769 p
->rmargin
= p
->maxrmargin
> p
->offset
?
770 p
->maxrmargin
: p
->offset
;
772 p
->flags
&= ~TERMP_NOBREAK
;
793 p
->offset
= mt
->offset
;
809 mt
->fl
&= ~MANT_LITERAL
;
810 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
811 mt
->offset
= term_len(p
, p
->defindent
);
812 /* If following a prior empty `SS', no vspace. */
813 if (n
->prev
&& MAN_SS
== n
->prev
->tok
)
814 if (NULL
== n
->prev
->body
->child
)
818 for (i
= 0; i
< mt
->pardist
; i
++)
822 term_fontrepl(p
, TERMFONT_BOLD
);
823 p
->offset
= term_len(p
, 3);
826 p
->offset
= mt
->offset
;
862 mt
->fl
&= ~MANT_LITERAL
;
863 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
864 mt
->offset
= term_len(p
, p
->defindent
);
865 /* If following a prior empty `SH', no vspace. */
866 if (n
->prev
&& MAN_SH
== n
->prev
->tok
)
867 if (NULL
== n
->prev
->body
->child
)
869 /* If the first macro, no vspae. */
872 for (i
= 0; i
< mt
->pardist
; i
++)
876 term_fontrepl(p
, TERMFONT_BOLD
);
880 p
->offset
= mt
->offset
;
924 sz
= term_len(p
, p
->defindent
);
926 if (NULL
!= (n
= n
->parent
->head
->child
))
927 if ((ival
= a2width(p
, n
->string
)) >= 0)
931 p
->offset
= mt
->offset
;
932 p
->rmargin
= p
->maxrmargin
> p
->offset
?
933 p
->maxrmargin
: p
->offset
;
935 if (++mt
->lmarginsz
< MAXMARGINS
)
936 mt
->lmargincur
= mt
->lmarginsz
;
938 mt
->lmargin
[mt
->lmargincur
] = mt
->lmargin
[mt
->lmargincur
- 1];
959 sz
= term_len(p
, p
->defindent
);
961 if (NULL
!= (n
= n
->parent
->head
->child
))
962 if ((ival
= a2width(p
, n
->string
)) >= 0)
965 mt
->offset
= mt
->offset
< sz
? 0 : mt
->offset
- sz
;
966 p
->offset
= mt
->offset
;
968 if (--mt
->lmarginsz
< MAXMARGINS
)
969 mt
->lmargincur
= mt
->lmarginsz
;
977 return (MAN_HEAD
!= n
->type
);
985 if (MAN_BLOCK
!= n
->type
)
989 p
->flags
|= TERMP_NOSPACE
;
991 if (NULL
!= n
->child
->child
)
992 print_man_node(p
, mt
, n
->child
->child
, meta
);
994 p
->flags
|= TERMP_NOSPACE
;
999 print_man_node(DECL_ARGS
)
1007 * If we have a blank line, output a vertical space.
1008 * If we have a space as the first character, break
1009 * before printing the line's data.
1011 if ('\0' == *n
->string
) {
1014 } else if (' ' == *n
->string
&& MAN_LINE
& n
->flags
)
1017 term_word(p
, n
->string
);
1021 term_eqn(p
, n
->eqn
);
1025 * Tables are preceded by a newline. Then process a
1026 * table line, which will cause line termination,
1028 if (TBL_SPAN_FIRST
& n
->span
->flags
)
1030 term_tbl(p
, n
->span
);
1036 if ( ! (MAN_NOTEXT
& termacts
[n
->tok
].flags
))
1037 term_fontrepl(p
, TERMFONT_NONE
);
1040 if (termacts
[n
->tok
].pre
)
1041 c
= (*termacts
[n
->tok
].pre
)(p
, mt
, n
, meta
);
1044 print_man_nodelist(p
, mt
, n
->child
, meta
);
1046 if (termacts
[n
->tok
].post
)
1047 (*termacts
[n
->tok
].post
)(p
, mt
, n
, meta
);
1048 if ( ! (MAN_NOTEXT
& termacts
[n
->tok
].flags
))
1049 term_fontrepl(p
, TERMFONT_NONE
);
1053 * If we're in a literal context, make sure that words
1054 * together on the same line stay together. This is a
1055 * POST-printing call, so we check the NEXT word. Since
1056 * -man doesn't have nested macros, we don't need to be
1057 * more specific than this.
1059 if (MANT_LITERAL
& mt
->fl
&& ! (TERMP_NOBREAK
& p
->flags
) &&
1060 (NULL
== n
->next
|| MAN_LINE
& n
->next
->flags
)) {
1062 rmax
= p
->maxrmargin
;
1063 p
->rmargin
= p
->maxrmargin
= TERM_MAXMARGIN
;
1064 p
->flags
|= TERMP_NOSPACE
;
1065 if (NULL
!= n
->string
&& '\0' != *n
->string
)
1069 if (rm
< rmax
&& n
->parent
->tok
== MAN_HP
) {
1074 p
->maxrmargin
= rmax
;
1076 if (MAN_EOS
& n
->flags
)
1077 p
->flags
|= TERMP_SENTENCE
;
1082 print_man_nodelist(DECL_ARGS
)
1085 print_man_node(p
, mt
, n
, meta
);
1088 print_man_nodelist(p
, mt
, n
->next
, meta
);
1093 print_man_foot(struct termp
*p
, const void *arg
)
1097 const struct man_meta
*meta
;
1099 meta
= (const struct man_meta
*)arg
;
1100 assert(meta
->title
);
1104 term_fontrepl(p
, TERMFONT_NONE
);
1109 * Temporary, undocumented option to imitate mdoc(7) output.
1110 * In the bottom right corner, use the source instead of
1114 if ( ! p
->mdocstyle
) {
1117 snprintf(title
, BUFSIZ
, "%s(%s)", meta
->title
, meta
->msec
);
1118 } else if (meta
->source
) {
1119 strlcpy(title
, meta
->source
, BUFSIZ
);
1123 datelen
= term_strlen(p
, meta
->date
);
1125 /* Bottom left corner: manual source. */
1127 p
->flags
|= TERMP_NOSPACE
| TERMP_NOBREAK
;
1130 p
->rmargin
= (p
->maxrmargin
- datelen
+ term_len(p
, 1)) / 2;
1133 term_word(p
, meta
->source
);
1136 /* At the bottom in the middle: manual date. */
1138 p
->flags
|= TERMP_NOSPACE
;
1139 p
->offset
= p
->rmargin
;
1140 p
->rmargin
= p
->maxrmargin
- term_strlen(p
, title
);
1141 if (p
->offset
+ datelen
>= p
->rmargin
)
1142 p
->rmargin
= p
->offset
+ datelen
;
1144 term_word(p
, meta
->date
);
1147 /* Bottom right corner: manual title and section. */
1149 p
->flags
&= ~TERMP_NOBREAK
;
1150 p
->flags
|= TERMP_NOSPACE
;
1152 p
->offset
= p
->rmargin
;
1153 p
->rmargin
= p
->maxrmargin
;
1155 term_word(p
, title
);
1161 print_man_head(struct termp
*p
, const void *arg
)
1163 char buf
[BUFSIZ
], title
[BUFSIZ
];
1164 size_t buflen
, titlen
;
1165 const struct man_meta
*meta
;
1167 meta
= (const struct man_meta
*)arg
;
1168 assert(meta
->title
);
1172 strlcpy(buf
, meta
->vol
, BUFSIZ
);
1175 buflen
= term_strlen(p
, buf
);
1177 /* Top left corner: manual title and section. */
1179 snprintf(title
, BUFSIZ
, "%s(%s)", meta
->title
, meta
->msec
);
1180 titlen
= term_strlen(p
, title
);
1182 p
->flags
|= TERMP_NOBREAK
| TERMP_NOSPACE
;
1185 p
->rmargin
= 2 * (titlen
+1) + buflen
< p
->maxrmargin
?
1187 term_strlen(p
, buf
) + term_len(p
, 1)) / 2 :
1188 p
->maxrmargin
- buflen
;
1190 term_word(p
, title
);
1193 /* At the top in the middle: manual volume. */
1195 p
->flags
|= TERMP_NOSPACE
;
1196 p
->offset
= p
->rmargin
;
1197 p
->rmargin
= p
->offset
+ buflen
+ titlen
< p
->maxrmargin
?
1198 p
->maxrmargin
- titlen
: p
->maxrmargin
;
1203 /* Top right corner: title and section, again. */
1205 p
->flags
&= ~TERMP_NOBREAK
;
1207 if (p
->rmargin
+ titlen
<= p
->maxrmargin
) {
1208 p
->flags
|= TERMP_NOSPACE
;
1209 p
->offset
= p
->rmargin
;
1210 p
->rmargin
= p
->maxrmargin
;
1211 term_word(p
, title
);
1215 p
->flags
&= ~TERMP_NOSPACE
;
1217 p
->rmargin
= p
->maxrmargin
;
1220 * Groff prints three blank lines before the content.
1221 * Do the same, except in the temporary, undocumented
1222 * mode imitating mdoc(7) output.
1226 if ( ! p
->mdocstyle
) {