aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2019-01-05 21:18:26 +0000
committerIngo Schwarze <schwarze@openbsd.org>2019-01-05 21:18:26 +0000
commit90df3f10ba3a29b23b62fdad06cdae3f2c051e4f (patch)
tree4dfe2636e81047195b3964f2c3328e367e6bc3b8
parentc33a3366a3d5db0a3182110ecfe15ded97489b77 (diff)
downloadmandoc-90df3f10ba3a29b23b62fdad06cdae3f2c051e4f.tar.gz
mandoc-90df3f10ba3a29b23b62fdad06cdae3f2c051e4f.tar.zst
mandoc-90df3f10ba3a29b23b62fdad06cdae3f2c051e4f.zip
In groff, when the .SY block macro occurs in no-fill mode,
the output line gets broken after the head. Do the same.
-rw-r--r--man_term.c6
-rw-r--r--regress/man/Makefile4
-rw-r--r--regress/man/SY/Makefile5
-rw-r--r--regress/man/SY/literal.in32
-rw-r--r--regress/man/SY/literal.out_ascii27
5 files changed, 70 insertions, 4 deletions
diff --git a/man_term.c b/man_term.c
index 62b510ad..d867762d 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.227 2019/01/05 01:29:32 schwarze Exp $ */
+/* $Id: man_term.c,v 1.228 2019/01/05 21:18:26 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017-2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -833,7 +833,9 @@ pre_SY(DECL_ARGS)
case ROFFT_HEAD:
p->tcol->offset = mt->offset;
p->tcol->rmargin = mt->offset + len;
- p->flags |= TERMP_NOBREAK;
+ if (n->next->child == NULL ||
+ (n->next->child->flags & NODE_NOFILL) == 0)
+ p->flags |= TERMP_NOBREAK;
term_fontrepl(p, TERMFONT_BOLD);
break;
case ROFFT_BODY:
diff --git a/regress/man/Makefile b/regress/man/Makefile
index fb3e40bf..23d6e04b 100644
--- a/regress/man/Makefile
+++ b/regress/man/Makefile
@@ -1,6 +1,6 @@
-# $OpenBSD: Makefile,v 1.17 2015/03/20 16:09:25 schwarze Exp $
+# $OpenBSD: Makefile,v 1.19 2019/01/05 21:13:55 schwarze Exp $
-SUBDIR = B BI EX HP IP MT OP PD PP RS SH SS TH TP TS UR nf blank
+SUBDIR = B BI EX HP IP MT OP PD PP RS SH SS SY TH TP TS UR nf blank
.include "../Makefile.sub"
.include <bsd.subdir.mk>
diff --git a/regress/man/SY/Makefile b/regress/man/SY/Makefile
new file mode 100644
index 00000000..54045804
--- /dev/null
+++ b/regress/man/SY/Makefile
@@ -0,0 +1,5 @@
+# $OpenBSD: Makefile,v 1.1 2019/01/05 21:13:55 schwarze Exp $
+
+REGRESS_TARGETS = literal
+
+.include <bsd.regress.mk>
diff --git a/regress/man/SY/literal.in b/regress/man/SY/literal.in
new file mode 100644
index 00000000..081904c0
--- /dev/null
+++ b/regress/man/SY/literal.in
@@ -0,0 +1,32 @@
+.\" $OpenBSD: literal.in,v 1.1 2019/01/05 21:13:55 schwarze Exp $
+.TH SY-LITERAL 1 "January 5, 2019"
+.SH NAME
+SY-literal \- synopsis block in literal context
+.SH DESCRIPTION
+BEGINTEST
+.br
+initial
+regular
+text
+.SY command
+.I arguments
+.YS
+middle
+regular
+text
+.nf
+literal text
+before display
+.SY command
+.I arguments
+.YS
+literal text
+after display
+.fi
+final
+regular
+text
+.br
+ENDTEST
+.br
+end of file
diff --git a/regress/man/SY/literal.out_ascii b/regress/man/SY/literal.out_ascii
new file mode 100644
index 00000000..ae0044df
--- /dev/null
+++ b/regress/man/SY/literal.out_ascii
@@ -0,0 +1,27 @@
+SY-LITERAL(1) General Commands Manual SY-LITERAL(1)
+
+
+
+NNAAMMEE
+ SY-literal - synopsis block in literal context
+
+DDEESSCCRRIIPPTTIIOONN
+ BEGINTEST
+ initial regular text
+
+ ccoommmmaanndd _a_r_g_u_m_e_n_t_s
+ middle regular text
+ literal text
+ before display
+
+ ccoommmmaanndd
+ _a_r_g_u_m_e_n_t_s
+ literal text
+ after display
+ final regular text
+ ENDTEST
+ end of file
+
+
+
+OpenBSD January 5, 2019 SY-LITERAL(1)