diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-11-10 22:54:40 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-11-10 22:54:40 +0000 |
commit | b62bcd63e382e3538d704cd43ecca19bbf9c568b (patch) | |
tree | 3b4608c27a1122002de3c81428891d5650093b9f /man.c | |
parent | 686b4d965f981326a795a8476888351e5cfe3ae9 (diff) | |
download | mandoc-b62bcd63e382e3538d704cd43ecca19bbf9c568b.tar.gz |
Ignore blank lines right after .SH and .SS.
Improves the rendering of gpg(1); issue reported by jca on ports.
Diffstat (limited to 'man.c')
-rw-r--r-- | man.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -429,16 +429,22 @@ man_ptext(struct man *man, int line, char *buf, int offs) return(man_descope(man, line, offs)); } - /* Pump blank lines directly into the backend. */ - for (i = offs; ' ' == buf[i]; i++) /* Skip leading whitespace. */ ; + /* + * Blank lines are ignored right after headings + * but add a single vertical space elsewhere. + */ + if ('\0' == buf[i]) { /* Allocate a blank entry. */ - if ( ! man_elem_alloc(man, line, offs, MAN_sp)) - return(0); - man->next = MAN_NEXT_SIBLING; + if (MAN_SH != man->last->tok && + MAN_SS != man->last->tok) { + if ( ! man_elem_alloc(man, line, offs, MAN_sp)) + return(0); + man->next = MAN_NEXT_SIBLING; + } return(1); } |