diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-08-18 14:02:53 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-08-18 14:02:53 +0000 |
commit | 7c95cb5adc73d3214547e1ffe7c7fae748b22783 (patch) | |
tree | 829f5b79e07f1b8cfa8d26ad53d72ed15bf2049f /usr.bin | |
parent | 6b379d008ea7bae3cef396ec0c443c0358089e9c (diff) |
Two consecutive .SY blocks only get a blank line in between
if the first one is explicitly closed with .YS.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/man_macro.c | 11 | ||||
-rw-r--r-- | usr.bin/mandoc/man_term.c | 5 |
2 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c index 7e760adb45f..6b17f1fcbce 100644 --- a/usr.bin/mandoc/man_macro.c +++ b/usr.bin/mandoc/man_macro.c @@ -1,4 +1,4 @@ -/* $OpenBSD: man_macro.c,v 1.90 2018/08/18 02:03:41 schwarze Exp $ */ +/* $OpenBSD: man_macro.c,v 1.91 2018/08/18 14:02:52 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2012-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> @@ -69,7 +69,7 @@ static const struct man_macro man_macros[MAN_MAX - MAN_TH] = { { in_line_eoln, MAN_NSCOPED }, /* PD */ { in_line_eoln, 0 }, /* AT */ { in_line_eoln, MAN_NSCOPED }, /* in */ - { blk_exp, MAN_BSCOPE }, /* SY */ + { blk_imp, MAN_BSCOPE }, /* SY */ { blk_close, MAN_BSCOPE }, /* YS */ { in_line_eoln, 0 }, /* OP */ { in_line_eoln, MAN_BSCOPE }, /* EX */ @@ -268,6 +268,13 @@ blk_close(MACRO_PROT_ARGS) *pos = strlen(buf); blk_imp(man, ctok, cline, cpos, pos, buf); } + + /* Synopsis blocks need an explicit end marker for spacing. */ + + if (tok == MAN_YS && man->last == nn) { + roff_elem_alloc(man, line, ppos, tok); + man_unscope(man, man->last); + } } void diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c index 5cc04456b70..b7b806e393a 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.169 2018/08/18 13:04:48 schwarze Exp $ */ +/* $OpenBSD: man_term.c,v 1.170 2018/08/18 14:02:52 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org> @@ -859,7 +859,8 @@ pre_SY(DECL_ARGS) switch (n->type) { case ROFFT_BLOCK: - print_bvspace(p, n, mt->pardist); + if (n->prev == NULL || n->prev->tok != MAN_SY) + print_bvspace(p, n, mt->pardist); return 1; case ROFFT_HEAD: case ROFFT_BODY: |