tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
From: Ingo Schwarze <schwarze@usta.de>
To: Steffen Nurpmeso <sdaoden@yandex.com>
Cc: tech@mdocml.bsd.lv
Subject: Re: Nested list spacing issue
Date: Mon, 10 Nov 2014 23:06:14 +0100	[thread overview]
Message-ID: <20141110220614.GD20056@iris.usta.de> (raw)
In-Reply-To: <20141110190318.BxZAODsW%sdaoden@yandex.com>

Hi Steffen,

Steffen Nurpmeso wrote on Mon, Nov 10, 2014 at 08:03:18PM +0100:

> forget about this, this is an issue with mawk(1) which doesn't
[...]
> Sorry for the noise.

Well, i didn't look at the mawk(1) issue, but your bug report
with respect to mandoc(1) is valid in any case, and i have fixed it.

> I'm sure it's known

This bug was not known, thanks for reporting.

> but i can't find a TODO entry in cvs(1) HEAD:
> suppose this
> 
>   .Sh TABLE OF CONTENTS
>   .Bl -inset
>   .It Sx "DESCRIPTION"
>   .Bl -tag -offset indent
>   .It Sx "Creating a table of contents"
>   ...
>   .El
>   ...
>   .El
> 
> In groff v1.22.3 you will see
> 
>   TABLE OF CONTENTS
>        DESCRIPTION
> 
>              Creating a table of contents
> 
> but in mandoc v1.13.1 you get
> 
>   TABLE OF CONTENTS
>        DESCRIPTION
>              Creating a table of contents
> 
> which i think lacks an initial vertical space when the .Bl is
> opened?

Correct analysis.

> A different approach could be found below, but i don't
> know if it's always like that (and am too lazy to evaluate).

Frankly, the COMPATIBILITY section is a mess.
It lists minor issues that probably aren't worth it
while lacking warnings about more important issues at the same time.
One day, i'll have to clean it up.

Yours,
  Ingo


Log Message:
-----------
add required vertical spacing before lists that begin 
at the beginning of the first item of an enclosing list 
right at the beginning of a new section or subsection;
minibug reported by Steffen Nurpmeso <sdaoden at yandex dot com>

Modified Files:
--------------
    mdocml:
        mdoc_term.c

Revision Data
-------------
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.288
retrieving revision 1.289
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.288 -r1.289
--- mdoc_term.c
+++ mdoc_term.c
@@ -572,16 +572,18 @@ print_bvspace(struct termp *p,
 
 	/* Do not vspace directly after Ss/Sh. */
 
-	for (nn = n; nn; nn = nn->parent) {
-		if (MDOC_BLOCK != nn->type)
-			continue;
-		if (MDOC_Ss == nn->tok)
+	nn = n;
+	while (nn->prev == NULL) {
+		do {
+			nn = nn->parent;
+			if (nn->type == MDOC_ROOT)
+				return;
+		} while (nn->type != MDOC_BLOCK);
+		if (nn->tok == MDOC_Sh || nn->tok == MDOC_Ss)
 			return;
-		if (MDOC_Sh == nn->tok)
-			return;
-		if (NULL == nn->prev)
-			continue;
-		break;
+		if (nn->tok == MDOC_It &&
+		    nn->parent->parent->norm->Bl.type != LIST_item)
+			break;
 	}
 
 	/* A `-column' does not assert vspace within the list. */
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

  reply	other threads:[~2014-11-10 22:06 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-10 17:40 Steffen Nurpmeso
2014-11-10 19:03 ` Steffen Nurpmeso
2014-11-10 22:06   ` Ingo Schwarze [this message]
2014-11-11 10:49     ` Steffen Nurpmeso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141110220614.GD20056@iris.usta.de \
    --to=schwarze@usta.de \
    --cc=sdaoden@yandex.com \
    --cc=tech@mdocml.bsd.lv \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).