Index: mdoc_html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_html.c,v
retrieving revision 1.99
diff -u -r1.99 mdoc_html.c
--- mdoc_html.c 23 Jul 2010 00:08:57 -0000 1.99
+++ mdoc_html.c 26 Jul 2010 23:51:15 -0000
@@ -1407,7 +1407,7 @@
mdoc_bd_pre(MDOC_ARGS)
{
struct htmlpair tag[2];
- int comp;
+ int comp, last;
const struct mdoc_node *nn;
struct roffsu su;
@@ -1456,15 +1456,14 @@
PAIR_STYLE_INIT(&tag[1], h);
print_otag(h, TAG_DIV, 2, tag);
+ last = 0;
for (nn = n->child; nn; nn = nn->next) {
- h->flags |= HTML_NOSPACE;
- print_mdoc_node(m, nn, h);
- if (NULL == nn->next)
- continue;
- if (nn->prev && nn->prev->line < nn->line)
- print_text(h, "\n");
- else if (NULL == nn->prev)
+ if (last && last < nn->line) {
print_text(h, "\n");
+ h->flags |= HTML_NOSPACE;
+ }
+ print_mdoc_node(m, nn, h);
+ last = nn->line;
}
return(0);
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.178
diff -u -r1.178 mdoc_term.c
--- mdoc_term.c 26 Jul 2010 22:35:59 -0000 1.178
+++ mdoc_term.c 26 Jul 2010 23:51:15 -0000
@@ -1621,8 +1621,8 @@
static int
termp_bd_pre(DECL_ARGS)
{
- size_t tabwidth;
- size_t rm, rmax;
+ size_t tabwidth, rm, rmax;
+ int last;
const struct mdoc_node *nn;
if (MDOC_BLOCK == n->type) {
@@ -1653,13 +1653,12 @@
rmax = p->maxrmargin;
p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
+ last = 0;
for (nn = n->child; nn; nn = nn->next) {
- p->flags |= TERMP_NOSPACE;
+ if (last && last < nn->line)
+ term_newln(p);
print_mdoc_node(p, pair, m, nn);
- if (NULL == nn->prev ||
- nn->prev->line < nn->line ||
- NULL == nn->next)
- term_flushln(p);
+ last = nn->line;
}
p->tabwidth = tabwidth;