diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-01-24 10:07:59 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-01-24 10:07:59 +0000 |
commit | 05e027ad025040e01b0bea189083510f7413890d (patch) | |
tree | cdac1a65ad7e5182ea42b140e6b06c453a88a808 | |
parent | 2e8ebce2b4b92110f661a44eed2a9afb7fdd6b4e (diff) |
preserve .PP before .RE; effect found in audio/pms(1)
-rw-r--r-- | regress/usr.bin/mandoc/man/RS/broken.in | 5 | ||||
-rw-r--r-- | regress/usr.bin/mandoc/man/RS/broken.out_ascii | 3 | ||||
-rw-r--r-- | usr.bin/mandoc/man_macro.c | 15 |
3 files changed, 21 insertions, 2 deletions
diff --git a/regress/usr.bin/mandoc/man/RS/broken.in b/regress/usr.bin/mandoc/man/RS/broken.in index 5c915c640fe..ea81c0c3e2c 100644 --- a/regress/usr.bin/mandoc/man/RS/broken.in +++ b/regress/usr.bin/mandoc/man/RS/broken.in @@ -37,4 +37,9 @@ Let's have a longer text here such that we can see the line break. .PP still indented .RE +trailing PP: +.RS +indented +.PP +.RE final text diff --git a/regress/usr.bin/mandoc/man/RS/broken.out_ascii b/regress/usr.bin/mandoc/man/RS/broken.out_ascii index 199ef05fbde..ab219ac1f49 100644 --- a/regress/usr.bin/mandoc/man/RS/broken.out_ascii +++ b/regress/usr.bin/mandoc/man/RS/broken.out_ascii @@ -31,6 +31,9 @@ DDEESSCCRRIIPPTTIIOONN break. still indented + trailing PP: + indented + final text diff --git a/usr.bin/mandoc/man_macro.c b/usr.bin/mandoc/man_macro.c index 96f8017cc50..56cd937d050 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.56 2015/01/24 02:41:32 schwarze Exp $ */ +/* $OpenBSD: man_macro.c,v 1.57 2015/01/24 10:07:58 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2012, 2013, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -317,8 +317,19 @@ blk_close(MACRO_PROT_ARGS) mandoc_msg(MANDOCERR_BLK_NOTOPEN, man->parse, line, ppos, man_macronames[tok]); rew_scope(MAN_BLOCK, man, MAN_PP); - } else + } else { + line = man->last->line; + ppos = man->last->pos; + ntok = man->last->tok; man_unscope(man, nn); + + /* Move a trailing paragraph behind the block. */ + + if (ntok == MAN_LP || ntok == MAN_PP || ntok == MAN_P) { + *pos = strlen(buf); + blk_imp(man, ntok, line, ppos, pos, buf); + } + } } void |