Debian / debiman

debiman generates a static manpage HTML repository out of a Debian archive
Apache License 2.0
188 stars 46 forks source link

Missing newline/paragraph break in preformatted text #109

Open df7cb opened 5 years ago

df7cb commented 5 years ago

The pg_buildext(1) manpage from postgresql-server-dev-all is rendered wrongly (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918129):

Original:

EXAMPLE
       debian/control.in:
             Source: postgresql-foobar
             Build-Depends: debhelper, postgresql-server-dev-all (>= 153~)
             XS-Testsuite: autopkgtest

             Package: postgresql-PGVERSION-foobar
             Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-PGVERSION

Rendered on https://manpages.debian.org/unstable/postgresql-server-dev-all/pg_buildext.1.en.html:

EXAMPLE
debian/control.in:
  Source: postgresql-foobar
  Build-Depends: debhelper, postgresql-server-dev-all (>= 153~)
  XS-Testsuite: autopkgtest
  Package: postgresql-PGVERSION-foobar
  Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-PGVERSION

Note that the paragraph break between the two sections is lost.

roff source:

.SH "EXAMPLE"
.IX Header "EXAMPLE"
.IP "\fBdebian/control.in:\fR" 4
.IX Item "debian/control.in:"
.Vb 2
\&  Source: postgresql\-foobar
\&  Build\-Depends: debhelper, postgresql\-server\-dev\-all (>= 153~)
\&
\&  Package: postgresql\-PGVERSION\-foobar
\&  Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql\-PGVERSION
.Ve

I believe this is a bug in debiman and not in the package/manpage.

stapelberg commented 5 years ago

Thanks for your report, Christoph.

This seems to be a shortcoming of mandoc, which we use for rendering:

% curl https://manpages.debian.org/unstable/postgresql-server-dev-all/pg_buildext.1.en.gz | mandoc -Thtml
[…]
<h1 class="Sh" title="Sh" id="EXAMPLE"><a class="permalink" href="#EXAMPLE">EXAMPLE</a></h1>
<dl class="Bl-tag">
  <dt><b>debian/control.in:</b></dt>
  <dd>
    <pre>
  Source: postgresql-foobar
  Build-Depends: debhelper, postgresql-server-dev-all (&gt;= 153~)
  XS-Testsuite: autopkgtest
  Package: postgresql-PGVERSION-foobar
  Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-PGVERSION
    </pre>
  </dd>
</dl>
[…]

@ischwarze Could you take a look at this please?

Thanks,

ischwarze commented 5 years ago

Hi Michael, hi Christoph,

my impression is this is already fixed in the HEAD of mandoc development in CVS.

I just tested with mandoc-1.14.4 (latest release, released in August 2018):

 $ ./man -l -Thtml pg_buildext.1.en.gz
[...]
<pre>
Source: postgresql-foobar
Build-Depends: debhelper, postgresql-server-dev-all (&gt;= 153~)
XS-Testsuite: autopkgtest
Package: postgresql-PGVERSION-foobar
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-PGVERSION
</pre>

and with mandoc-current:

 $ man -l -Thtml pg_buildext.1.en.gz
[...]
<pre>
Source: postgresql-foobar
Build-Depends: debhelper, postgresql-server-dev-all (&gt;= 153~)
XS-Testsuite: autopkgtest

Package: postgresql-PGVERSION-foobar
Depends: ${misc:Depends}, ${shlibs:Depends}, postgresql-PGVERSION
</pre>

I fear you won't be able to cherry-pick a bugfix, though. I recently did extensive work on improving paragraph handling, text filling, and support for literal paragraphs, see the brand-new journal article https://undeadly.org/cgi?action=article;sid=20190108193936

In particular, from that article:

In preparation for the above, large amounts of cleanup were performed,
improving separation of different modules of the mandoc program
and simplifying some aspects of the architecture.

How important is this? Should i roll a mandoc-1.14.5 release? Probably, because there are also several other improvements, right?

Yours, Ingo

stapelberg commented 5 years ago

Not too important, but a mandoc 1.14.5 release would be appreciated when you get a chance :)

Thanks for looking into it!