* mdocml: Translate blank input lines to .sp just like in mdoc(7), and
@ 2012-07-14 10:47 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2012-07-14 10:47 UTC (permalink / raw)
To: source
Log Message:
-----------
Translate blank input lines to .sp just like in mdoc(7),
and ignore .sp after .PP. This fixes vertical spacing
for blank lines after .PP and for .sp after .PP.
OpenBSD rev. man.c 1.68 and man_term.c 1.86
Modified Files:
--------------
mdocml:
man.c
man_term.c
Revision Data
-------------
Index: man_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man_term.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -Lman_term.c -Lman_term.c -u -p -r1.131 -r1.132
--- man_term.c
+++ man_term.c
@@ -445,10 +445,21 @@ pre_sp(DECL_ARGS)
int neg;
if ((NULL == n->prev && n->parent)) {
- if (MAN_SS == n->parent->tok)
- return(0);
- if (MAN_SH == n->parent->tok)
+ switch (n->parent->tok) {
+ case (MAN_SH):
+ /* FALLTHROUGH */
+ case (MAN_SS):
+ /* FALLTHROUGH */
+ case (MAN_PP):
+ /* FALLTHROUGH */
+ case (MAN_LP):
+ /* FALLTHROUGH */
+ case (MAN_P):
+ /* FALLTHROUGH */
return(0);
+ default:
+ break;
+ }
}
neg = 0;
Index: man.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/man.c,v
retrieving revision 1.117
retrieving revision 1.118
diff -Lman.c -Lman.c -u -p -r1.117 -r1.118
--- man.c
+++ man.c
@@ -435,9 +435,10 @@ man_ptext(struct man *m, int line, char
if ('\0' == buf[i]) {
/* Allocate a blank entry. */
- if ( ! man_word_alloc(m, line, offs, ""))
+ if ( ! man_elem_alloc(m, line, offs, MAN_sp))
return(0);
- return(man_descope(m, line, offs));
+ m->next = MAN_NEXT_SIBLING;
+ return(1);
}
/*
--
To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2012-07-14 10:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-14 10:47 mdocml: Translate blank input lines to .sp just like in mdoc(7), and schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).