]>
git.cameronkatri.com Git - mandoc.git/blob - man_term.c
1 /* $Id: man_term.c,v 1.142 2014/03/08 16:22:04 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_sp(DECL_ARGS
);
89 static void post_IP(DECL_ARGS
);
90 static void post_HP(DECL_ARGS
);
91 static void post_RS(DECL_ARGS
);
92 static void post_SH(DECL_ARGS
);
93 static void post_SS(DECL_ARGS
);
94 static void post_TP(DECL_ARGS
);
95 static void post_UR(DECL_ARGS
);
97 static const struct termact termacts
[MAN_MAX
] = {
98 { pre_sp
, NULL
, MAN_NOTEXT
}, /* br */
99 { NULL
, NULL
, 0 }, /* TH */
100 { pre_SH
, post_SH
, 0 }, /* SH */
101 { pre_SS
, post_SS
, 0 }, /* SS */
102 { pre_TP
, post_TP
, 0 }, /* TP */
103 { pre_PP
, NULL
, 0 }, /* LP */
104 { pre_PP
, NULL
, 0 }, /* PP */
105 { pre_PP
, NULL
, 0 }, /* P */
106 { pre_IP
, post_IP
, 0 }, /* IP */
107 { pre_HP
, post_HP
, 0 }, /* HP */
108 { NULL
, NULL
, 0 }, /* SM */
109 { pre_B
, NULL
, 0 }, /* SB */
110 { pre_alternate
, NULL
, 0 }, /* BI */
111 { pre_alternate
, NULL
, 0 }, /* IB */
112 { pre_alternate
, NULL
, 0 }, /* BR */
113 { pre_alternate
, NULL
, 0 }, /* RB */
114 { NULL
, NULL
, 0 }, /* R */
115 { pre_B
, NULL
, 0 }, /* B */
116 { pre_I
, NULL
, 0 }, /* I */
117 { pre_alternate
, NULL
, 0 }, /* IR */
118 { pre_alternate
, NULL
, 0 }, /* RI */
119 { pre_ign
, NULL
, MAN_NOTEXT
}, /* na */
120 { pre_sp
, NULL
, MAN_NOTEXT
}, /* sp */
121 { pre_literal
, NULL
, 0 }, /* nf */
122 { pre_literal
, NULL
, 0 }, /* fi */
123 { NULL
, NULL
, 0 }, /* RE */
124 { pre_RS
, post_RS
, 0 }, /* RS */
125 { pre_ign
, NULL
, 0 }, /* DT */
126 { pre_ign
, NULL
, 0 }, /* UC */
127 { pre_PD
, NULL
, MAN_NOTEXT
}, /* PD */
128 { pre_ign
, NULL
, 0 }, /* AT */
129 { pre_in
, NULL
, MAN_NOTEXT
}, /* in */
130 { pre_ft
, NULL
, MAN_NOTEXT
}, /* ft */
131 { pre_OP
, NULL
, 0 }, /* OP */
132 { pre_literal
, NULL
, 0 }, /* EX */
133 { pre_literal
, NULL
, 0 }, /* EE */
134 { pre_UR
, post_UR
, 0 }, /* UR */
135 { NULL
, NULL
, 0 }, /* UE */
141 terminal_man(void *arg
, const struct man
*man
)
144 const struct man_node
*n
;
145 const struct man_meta
*meta
;
148 p
= (struct termp
*)arg
;
150 if (0 == p
->defindent
)
154 p
->maxrmargin
= p
->defrmargin
;
155 p
->tabwidth
= term_len(p
, 5);
157 if (NULL
== p
->symtab
)
158 p
->symtab
= mchars_alloc();
161 meta
= man_meta(man
);
163 term_begin(p
, print_man_head
, print_man_foot
, meta
);
164 p
->flags
|= TERMP_NOSPACE
;
166 memset(&mt
, 0, sizeof(struct mtermp
));
168 mt
.lmargin
[mt
.lmargincur
] = term_len(p
, p
->defindent
);
169 mt
.offset
= term_len(p
, p
->defindent
);
173 print_man_nodelist(p
, &mt
, n
->child
, meta
);
180 a2height(const struct termp
*p
, const char *cp
)
184 if ( ! a2roffsu(cp
, &su
, SCALE_VS
))
185 SCALE_VS_INIT(&su
, atoi(cp
));
187 return(term_vspan(p
, &su
));
192 a2width(const struct termp
*p
, const char *cp
)
196 if ( ! a2roffsu(cp
, &su
, SCALE_BU
))
199 return((int)term_hspan(p
, &su
));
203 * Printing leading vertical space before a block.
204 * This is used for the paragraph macros.
205 * The rules are pretty simple, since there's very little nesting going
206 * on here. Basically, if we're the first within another block (SS/SH),
207 * then don't emit vertical space. If we are (RS), then do. If not the
211 print_bvspace(struct termp
*p
, const struct man_node
*n
, int pardist
)
217 if (n
->body
&& n
->body
->child
)
218 if (MAN_TBL
== n
->body
->child
->type
)
221 if (MAN_ROOT
== n
->parent
->type
|| MAN_RS
!= n
->parent
->tok
)
225 for (i
= 0; i
< pardist
; i
++)
243 term_fontrepl(p
, TERMFONT_UNDER
);
250 pre_literal(DECL_ARGS
)
255 if (MAN_nf
== n
->tok
|| MAN_EX
== n
->tok
)
256 mt
->fl
|= MANT_LITERAL
;
258 mt
->fl
&= ~MANT_LITERAL
;
261 * Unlike .IP and .TP, .HP does not have a HEAD.
262 * So in case a second call to term_flushln() is needed,
263 * indentation has to be set up explicitly.
265 if (MAN_HP
== n
->parent
->tok
&& p
->rmargin
< p
->maxrmargin
) {
266 p
->offset
= p
->rmargin
;
267 p
->rmargin
= p
->maxrmargin
;
269 p
->flags
&= ~TERMP_NOBREAK
;
270 p
->flags
|= TERMP_NOSPACE
;
286 assert(MAN_TEXT
== n
->type
);
287 mt
->pardist
= atoi(n
->string
);
293 pre_alternate(DECL_ARGS
)
295 enum termfont font
[2];
296 const struct man_node
*nn
;
301 font
[0] = TERMFONT_NONE
;
302 font
[1] = TERMFONT_BOLD
;
305 font
[0] = TERMFONT_NONE
;
306 font
[1] = TERMFONT_UNDER
;
309 font
[0] = TERMFONT_BOLD
;
310 font
[1] = TERMFONT_NONE
;
313 font
[0] = TERMFONT_BOLD
;
314 font
[1] = TERMFONT_UNDER
;
317 font
[0] = TERMFONT_UNDER
;
318 font
[1] = TERMFONT_NONE
;
321 font
[0] = TERMFONT_UNDER
;
322 font
[1] = TERMFONT_BOLD
;
328 savelit
= MANT_LITERAL
& mt
->fl
;
329 mt
->fl
&= ~MANT_LITERAL
;
331 for (i
= 0, nn
= n
->child
; nn
; nn
= nn
->next
, i
= 1 - i
) {
332 term_fontrepl(p
, font
[i
]);
333 if (savelit
&& NULL
== nn
->next
)
334 mt
->fl
|= MANT_LITERAL
;
335 print_man_node(p
, mt
, nn
, meta
);
337 p
->flags
|= TERMP_NOSPACE
;
348 term_fontrepl(p
, TERMFONT_BOLD
);
358 p
->flags
|= TERMP_NOSPACE
;
360 if (NULL
!= (n
= n
->child
)) {
361 term_fontrepl(p
, TERMFONT_BOLD
);
362 term_word(p
, n
->string
);
364 if (NULL
!= n
&& NULL
!= n
->next
) {
365 term_fontrepl(p
, TERMFONT_UNDER
);
366 term_word(p
, n
->next
->string
);
369 term_fontrepl(p
, TERMFONT_NONE
);
370 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
);
426 if (NULL
== n
->child
) {
427 p
->offset
= mt
->offset
;
431 cp
= n
->child
->string
;
441 if ((len
= a2width(p
, ++cp
)) < 0)
447 p
->offset
-= p
->offset
> v
? v
: p
->offset
;
453 /* Don't let this creep beyond the right margin. */
455 if (p
->offset
> p
->rmargin
)
456 p
->offset
= p
->rmargin
;
470 if ((NULL
== n
->prev
&& n
->parent
)) {
471 switch (n
->parent
->tok
) {
494 if (NULL
== n
->child
) {
498 s
= n
->child
->string
;
503 len
= a2height(p
, s
);
512 for (i
= 0; i
< len
; i
++)
525 const struct man_node
*nn
;
529 print_bvspace(p
, n
, mt
->pardist
);
537 if ( ! (MANT_LITERAL
& mt
->fl
)) {
538 p
->flags
|= TERMP_NOBREAK
;
542 len
= mt
->lmargin
[mt
->lmargincur
];
545 /* Calculate offset. */
547 if (NULL
!= (nn
= n
->parent
->head
->child
))
548 if ((ival
= a2width(p
, nn
->string
)) >= 0)
551 one
= term_len(p
, 1);
555 p
->offset
= mt
->offset
;
556 p
->rmargin
= mt
->offset
+ len
;
559 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
573 p
->flags
&= ~TERMP_NOBREAK
;
575 p
->offset
= mt
->offset
;
576 p
->rmargin
= p
->maxrmargin
;
591 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
592 print_bvspace(p
, n
, mt
->pardist
);
595 p
->offset
= mt
->offset
;
599 return(MAN_HEAD
!= n
->type
);
607 const struct man_node
*nn
;
613 p
->flags
|= TERMP_NOSPACE
;
616 p
->flags
|= TERMP_NOBREAK
;
620 print_bvspace(p
, n
, mt
->pardist
);
626 len
= mt
->lmargin
[mt
->lmargincur
];
629 /* Calculate the offset from the optional second argument. */
630 if (NULL
!= (nn
= n
->parent
->head
->child
))
631 if (NULL
!= (nn
= nn
->next
))
632 if ((ival
= a2width(p
, nn
->string
)) >= 0)
637 /* Handle zero-width lengths. */
639 len
= term_len(p
, 1);
641 p
->offset
= mt
->offset
;
642 p
->rmargin
= mt
->offset
+ len
;
646 /* Set the saved left-margin. */
647 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
649 savelit
= MANT_LITERAL
& mt
->fl
;
650 mt
->fl
&= ~MANT_LITERAL
;
653 print_man_node(p
, mt
, n
->child
, meta
);
656 mt
->fl
|= MANT_LITERAL
;
660 p
->offset
= mt
->offset
+ len
;
661 p
->rmargin
= p
->maxrmargin
> p
->offset
?
662 p
->maxrmargin
: p
->offset
;
680 p
->flags
&= ~TERMP_NOBREAK
;
682 p
->rmargin
= p
->maxrmargin
;
686 p
->offset
= mt
->offset
;
698 const struct man_node
*nn
;
704 p
->flags
|= TERMP_NOBREAK
;
708 p
->flags
|= TERMP_NOSPACE
;
711 print_bvspace(p
, n
, mt
->pardist
);
717 len
= (size_t)mt
->lmargin
[mt
->lmargincur
];
720 /* Calculate offset. */
722 if (NULL
!= (nn
= n
->parent
->head
->child
))
723 if (nn
->string
&& 0 == (MAN_LINE
& nn
->flags
))
724 if ((ival
= a2width(p
, nn
->string
)) >= 0)
729 /* Handle zero-length properly. */
731 len
= term_len(p
, 1);
733 p
->offset
= mt
->offset
;
734 p
->rmargin
= mt
->offset
+ len
;
736 savelit
= MANT_LITERAL
& mt
->fl
;
737 mt
->fl
&= ~MANT_LITERAL
;
739 /* Don't print same-line elements. */
741 while (NULL
!= nn
&& 0 == (MAN_LINE
& nn
->flags
))
745 print_man_node(p
, mt
, nn
, meta
);
750 mt
->fl
|= MANT_LITERAL
;
752 mt
->lmargin
[mt
->lmargincur
] = (size_t)ival
;
756 p
->offset
= mt
->offset
+ len
;
757 p
->rmargin
= p
->maxrmargin
> p
->offset
?
758 p
->maxrmargin
: p
->offset
;
760 p
->flags
&= ~TERMP_NOBREAK
;
781 p
->offset
= mt
->offset
;
797 mt
->fl
&= ~MANT_LITERAL
;
798 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
799 mt
->offset
= term_len(p
, p
->defindent
);
800 /* If following a prior empty `SS', no vspace. */
801 if (n
->prev
&& MAN_SS
== n
->prev
->tok
)
802 if (NULL
== n
->prev
->body
->child
)
806 for (i
= 0; i
< mt
->pardist
; i
++)
810 term_fontrepl(p
, TERMFONT_BOLD
);
811 p
->offset
= term_len(p
, 3);
814 p
->offset
= mt
->offset
;
850 mt
->fl
&= ~MANT_LITERAL
;
851 mt
->lmargin
[mt
->lmargincur
] = term_len(p
, p
->defindent
);
852 mt
->offset
= term_len(p
, p
->defindent
);
853 /* If following a prior empty `SH', no vspace. */
854 if (n
->prev
&& MAN_SH
== n
->prev
->tok
)
855 if (NULL
== n
->prev
->body
->child
)
857 /* If the first macro, no vspae. */
860 for (i
= 0; i
< mt
->pardist
; i
++)
864 term_fontrepl(p
, TERMFONT_BOLD
);
868 p
->offset
= mt
->offset
;
912 sz
= term_len(p
, p
->defindent
);
914 if (NULL
!= (n
= n
->parent
->head
->child
))
915 if ((ival
= a2width(p
, n
->string
)) >= 0)
919 p
->offset
= mt
->offset
;
920 p
->rmargin
= p
->maxrmargin
> p
->offset
?
921 p
->maxrmargin
: p
->offset
;
923 if (++mt
->lmarginsz
< MAXMARGINS
)
924 mt
->lmargincur
= mt
->lmarginsz
;
926 mt
->lmargin
[mt
->lmargincur
] = mt
->lmargin
[mt
->lmargincur
- 1];
947 sz
= term_len(p
, p
->defindent
);
949 if (NULL
!= (n
= n
->parent
->head
->child
))
950 if ((ival
= a2width(p
, n
->string
)) >= 0)
953 mt
->offset
= mt
->offset
< sz
? 0 : mt
->offset
- sz
;
954 p
->offset
= mt
->offset
;
956 if (--mt
->lmarginsz
< MAXMARGINS
)
957 mt
->lmargincur
= mt
->lmarginsz
;
965 return (MAN_HEAD
!= n
->type
);
973 if (MAN_BLOCK
!= n
->type
)
977 p
->flags
|= TERMP_NOSPACE
;
979 if (NULL
!= n
->child
->child
)
980 print_man_node(p
, mt
, n
->child
->child
, meta
);
982 p
->flags
|= TERMP_NOSPACE
;
987 print_man_node(DECL_ARGS
)
995 * If we have a blank line, output a vertical space.
996 * If we have a space as the first character, break
997 * before printing the line's data.
999 if ('\0' == *n
->string
) {
1002 } else if (' ' == *n
->string
&& MAN_LINE
& n
->flags
)
1005 term_word(p
, n
->string
);
1009 term_eqn(p
, n
->eqn
);
1013 * Tables are preceded by a newline. Then process a
1014 * table line, which will cause line termination,
1016 if (TBL_SPAN_FIRST
& n
->span
->flags
)
1018 term_tbl(p
, n
->span
);
1024 if ( ! (MAN_NOTEXT
& termacts
[n
->tok
].flags
))
1025 term_fontrepl(p
, TERMFONT_NONE
);
1028 if (termacts
[n
->tok
].pre
)
1029 c
= (*termacts
[n
->tok
].pre
)(p
, mt
, n
, meta
);
1032 print_man_nodelist(p
, mt
, n
->child
, meta
);
1034 if (termacts
[n
->tok
].post
)
1035 (*termacts
[n
->tok
].post
)(p
, mt
, n
, meta
);
1036 if ( ! (MAN_NOTEXT
& termacts
[n
->tok
].flags
))
1037 term_fontrepl(p
, TERMFONT_NONE
);
1041 * If we're in a literal context, make sure that words
1042 * together on the same line stay together. This is a
1043 * POST-printing call, so we check the NEXT word. Since
1044 * -man doesn't have nested macros, we don't need to be
1045 * more specific than this.
1047 if (MANT_LITERAL
& mt
->fl
&& ! (TERMP_NOBREAK
& p
->flags
) &&
1048 (NULL
== n
->next
|| MAN_LINE
& n
->next
->flags
)) {
1050 rmax
= p
->maxrmargin
;
1051 p
->rmargin
= p
->maxrmargin
= TERM_MAXMARGIN
;
1052 p
->flags
|= TERMP_NOSPACE
;
1053 if (NULL
!= n
->string
&& '\0' != *n
->string
)
1057 if (rm
< rmax
&& n
->parent
->tok
== MAN_HP
) {
1062 p
->maxrmargin
= rmax
;
1064 if (MAN_EOS
& n
->flags
)
1065 p
->flags
|= TERMP_SENTENCE
;
1070 print_man_nodelist(DECL_ARGS
)
1073 print_man_node(p
, mt
, n
, meta
);
1076 print_man_nodelist(p
, mt
, n
->next
, meta
);
1081 print_man_foot(struct termp
*p
, const void *arg
)
1085 const struct man_meta
*meta
;
1087 meta
= (const struct man_meta
*)arg
;
1088 assert(meta
->title
);
1092 term_fontrepl(p
, TERMFONT_NONE
);
1097 * Temporary, undocumented option to imitate mdoc(7) output.
1098 * In the bottom right corner, use the source instead of
1102 if ( ! p
->mdocstyle
) {
1105 snprintf(title
, BUFSIZ
, "%s(%s)", meta
->title
, meta
->msec
);
1106 } else if (meta
->source
) {
1107 strlcpy(title
, meta
->source
, BUFSIZ
);
1111 datelen
= term_strlen(p
, meta
->date
);
1113 /* Bottom left corner: manual source. */
1115 p
->flags
|= TERMP_NOSPACE
| TERMP_NOBREAK
;
1118 p
->rmargin
= (p
->maxrmargin
- datelen
+ term_len(p
, 1)) / 2;
1121 term_word(p
, meta
->source
);
1124 /* At the bottom in the middle: manual date. */
1126 p
->flags
|= TERMP_NOSPACE
;
1127 p
->offset
= p
->rmargin
;
1128 p
->rmargin
= p
->maxrmargin
- term_strlen(p
, title
);
1129 if (p
->offset
+ datelen
>= p
->rmargin
)
1130 p
->rmargin
= p
->offset
+ datelen
;
1132 term_word(p
, meta
->date
);
1135 /* Bottom right corner: manual title and section. */
1137 p
->flags
&= ~TERMP_NOBREAK
;
1138 p
->flags
|= TERMP_NOSPACE
;
1140 p
->offset
= p
->rmargin
;
1141 p
->rmargin
= p
->maxrmargin
;
1143 term_word(p
, title
);
1149 print_man_head(struct termp
*p
, const void *arg
)
1151 char buf
[BUFSIZ
], title
[BUFSIZ
];
1152 size_t buflen
, titlen
;
1153 const struct man_meta
*meta
;
1155 meta
= (const struct man_meta
*)arg
;
1156 assert(meta
->title
);
1160 strlcpy(buf
, meta
->vol
, BUFSIZ
);
1163 buflen
= term_strlen(p
, buf
);
1165 /* Top left corner: manual title and section. */
1167 snprintf(title
, BUFSIZ
, "%s(%s)", meta
->title
, meta
->msec
);
1168 titlen
= term_strlen(p
, title
);
1170 p
->flags
|= TERMP_NOBREAK
| TERMP_NOSPACE
;
1173 p
->rmargin
= 2 * (titlen
+1) + buflen
< p
->maxrmargin
?
1175 term_strlen(p
, buf
) + term_len(p
, 1)) / 2 :
1176 p
->maxrmargin
- buflen
;
1178 term_word(p
, title
);
1181 /* At the top in the middle: manual volume. */
1183 p
->flags
|= TERMP_NOSPACE
;
1184 p
->offset
= p
->rmargin
;
1185 p
->rmargin
= p
->offset
+ buflen
+ titlen
< p
->maxrmargin
?
1186 p
->maxrmargin
- titlen
: p
->maxrmargin
;
1191 /* Top right corner: title and section, again. */
1193 p
->flags
&= ~TERMP_NOBREAK
;
1195 if (p
->rmargin
+ titlen
<= p
->maxrmargin
) {
1196 p
->flags
|= TERMP_NOSPACE
;
1197 p
->offset
= p
->rmargin
;
1198 p
->rmargin
= p
->maxrmargin
;
1199 term_word(p
, title
);
1203 p
->flags
&= ~TERMP_NOSPACE
;
1205 p
->rmargin
= p
->maxrmargin
;
1208 * Groff prints three blank lines before the content.
1209 * Do the same, except in the temporary, undocumented
1210 * mode imitating mdoc(7) output.
1214 if ( ! p
->mdocstyle
) {