bugGNU roff - Bugs: bug #64267, [man] missing blank line before...

 
 

bug #64267: [man] missing blank line before section heading after empty paragraph in PD 0/IP/PD sequence

Submitter:  Alejandro Colomar <alx>
Submitted:  Wed 31 May 2023 09:41:32 PM UTC
   
 
Category:  Macro man Severity:  2 - Minor
Item Group:  Rendering/Cosmetics Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.24.0
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 16 Mar 2024 05:55:22 AM UTC, comment #3: 


commit a5d2ec1d3b8bf239e1e2760331248a363387f9c1
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri Mar 15 23:08:59 2024 -0500

    [man]: Fix Savannah #64267.

    * tmac/an.tmac (an-reset-paragraph-spacing): Restore spacing (that is,
      cancel no-space mode) to handle a "belated" call immediately after a
      paragraphing macro (`P`, `HP`, or `IP` with no marker argument).

    Fixes <https://savannah.gnu.org/bugs/index.php?64267>.  Thanks to Alex
    Colomar for the report.

commit 20bd38c24b2f9b7d9453777a7fcf9a3d0e7ce317
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Fri Mar 15 23:01:23 2024 -0500

    [man]: Regression-test Savannah #64267.

    * tmac/tests/tmac/tests/an_PD-restores-spacing.sh: Do it.
    * tmac/tmac.am (tmac_TESTS): Run test.

    Test fails at this commit.


G. Branden Robinson <gbranden>
Group administrator
Sat 16 Mar 2024 03:38:39 AM UTC, comment #2: 

Exhibit:


$ cat EXPERIMENTS/monsters.man
.TH foo 1 2024-03-15 "groff test suite"
.SH Name
foo \- frobnicate a bar
.SH Monsters
In this game reminiscent of
.IR rogue (6),
you can expect to encounter the following opponents in increasing order
of menace.
.
.PD 0
.IP B
bat
.IP T
troll
.P
.PD \" inexpert page author didn't put this _before_ the `P` call
.SH Treasure
There's a lot of it.


groff output (at least 1.22.3 to present, possibly forever):


$ ~/groff-1.22.3/bin/nroff -man EXPERIMENTS/monsters.man | cat -s
foo(1)                      General Commands Manual                     foo(1)

Name
       foo - frobnicate a bar

Monsters
       In  this  game reminiscent of rogue(6), you can expect to encounter the
       following opponents in increasing order of menace.
       B      bat
       T      troll
Treasure
       There's a lot of it.

groff test suite                  2024-03-15                            foo(1)


For our amusement, groff using the Seventh Edition Unix man macros:


$ nroff -C -M ./HISTORY/MAN/1979-01-v7 -manv7 -man EXPERIMENTS/monsters.man | cat -s

foo(1)               UNIX Programmer’s Manual              foo(1)

Name
     foo − frobnicate a bar

Monsters
     In this game reminiscent of rogue(6), you can expect to
     encounter the following opponents in increasing order of
     menace.
     B    bat
     T    troll

Treasure
     There’s a lot of it.

Printed 3/15/124            2024‐03‐15                          1


G. Branden Robinson <gbranden>
Group administrator
Wed 31 May 2023 10:25:49 PM UTC, comment #1: 

Thanks, Alex.

Pushing down to "minor" severity--it's hard for rendering/cosmetics problems to be "normal" or worse--but I regard this as being at the upper end of "minor".

I'll incorporate my comments to the mailing list about this by reference.

https://lists.gnu.org/archive/html/groff/2023-05/msg00130.html

G. Branden Robinson <gbranden>
Group administrator
Wed 31 May 2023 09:41:32 PM UTC, original submission:  

I had a typo in a man(7) page where for some reason I slipped an .IP
in the wrong place.  I had no warnings about that IP.  Neither
groff(1) nor mandoc(1) complained about it.  And BTW, mandoc(1)'s
behavior seems the right one to me.

We're lucky that this is not a regression, since groff-1.22.4 is
crappier (it has the same bug, and it even blows me with blank lines
in other unwanted places).

Here's the source:

 cat missing_blank.man
.TH a s d f
.SH qwe
rty.
.IP \[bu] 3
asd.
.PD 0
.IP \[bu] 3
fgh.
.IP
.PD
.SH jkl
zxc.

And here's what different formatters have to say about it:

$ /usr/bin/groff -ww -man -Tutf8 ./missing_blank.man
a(s)                                                                      a(s)



qwe
       rty.

       •  asd.
       •  fgh.
jkl
       zxc.



f                                      d                                  a(s)


$ /usr/local/bin/groff -ww -rCHECKSTYLE=3 -man -Tutf8 ./missing_blank.man
an.tmac:./missing_blank.man:1: style: .TH missing fifth argument and second argument 's' not a recognized manual section; specify its title
an.tmac:./missing_blank.man:6: style: use of deprecated macro: .PD
an.tmac:./missing_blank.man:10: style: use of deprecated macro: .PD
a(s)                                                                      a(s)

qwe
       rty.

       •  asd.
       •  fgh.
jkl
       zxc.

f                                      d                                  a(s)


$ mandoc -Tlint ./missing_blank.man
mandoc: ./missing_blank.man:1:5: STYLE: lower case character in document title: TH a
mandoc: ./missing_blank.man:1:9: WARNING: cannot parse date, using it verbatim: TH d


$ mandoc -man ./missing_blank.man
a(s)                                                                      a(s)

qwe
       rty.

       •  asd.
       •  fgh.

jkl
       zxc.

f                                      d                                  a(s)


We can see how mandoc(1), even if it doesn't warn about an ignored IP,
it correctly puts a blank before "jkl".

Alejandro Colomar <alx>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Posted a comment)
  • -email is unavailable- added by alx (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-03-16 gbranden StatusIn Progress Fixed
        Open/ClosedOpen Closed
        Planned ReleaseNone 1.24.0
    2024-03-16 gbranden StatusConfirmed In Progress
        Assigned toNone gbranden
    2023-05-31 gbranden Severity3 - Normal 2 - Minor
        StatusNone Confirmed
        SummaryMissing blank before SH due to PD 0 IP PD [man] missing blank line before section heading after empty paragraph in PD 0/IP/PD sequence

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code